<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <meta content="HTML Tidy for Cygwin (vers 1st February 2003), see www.w3.org" name="generator">
    <meta name="keywords" content="electronic commerce, ecommerce, ebusiness, e-business, e-commerce, enterprise software, net economy, Netscape, Sun Microsystems, DevEdge Archive, iPlanet, internet software">
    <meta name="description" content="The DevEdge Archive, a strategic alliance formed by America Online and Sun Microsystems, Inc., is delivering iPlanet e-commerce software and enterprise solutions that enable companies to compete successfully in the Net Economy">
    <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
    <meta name="TEMPLATEBASE" content="Authored in FrameMaker. Converted to HTML in WebWorks Publisher 2000. manual wdt 1.5">
    <meta name="LASTUPDATED" content="09/28/00 13:15:58">
    <title>
      Core JavaScript Reference 1.5:
    </title>
    <link rel="stylesheet" type="text/css" href="js15ref.css">
  </head>
  <body>
    <table width="100%" border="0" cellspacing="4">
      <tr>
        <td valign="top">
          <b><a class="sansserifPurple" href="regexp.html">Previous</a></b>&nbsp;&nbsp;&nbsp;&nbsp; <a href="contents.html"><b class="sansserifPurple">Contents</b></a>&nbsp;&nbsp;&nbsp;&nbsp; <a href="ix.html"><b class="sansserifPurple">Index</b></a>&nbsp;&nbsp;&nbsp;&nbsp; <a href="sun.html"><b class="sansserifPurple">Next</b></a> &nbsp;&nbsp;&nbsp;&nbsp;
        </td>
      </tr>
      <tr>
        <td class="sansserifBlack" valign="top" align="right" bgcolor="#CCCCCC">
          <b>Core JavaScript Reference 1.5</b>
        </td>
      </tr>
    </table><br>
     
    <blockquote>
      <br>
      <br>
      <br>
      <br>
       
      <p>
        <a name="1193137" id="1193137"></a> <a name="String" id="String"></a> <span class="sansserif"><b>String</b></span>
      </p>
      <p>
        <a name="1193173" id="1193173"></a> <span class="sansserif">An object representing a series of characters in a string.<br></span>
      </p><br>
       
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top" colspan="2" rowspan="1">
            <p>
              <a name="1193141" id="1193141"></a> <span class="sansserif"><i>Core object</i></span>
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1193145" id="1193145"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193147" id="1193147"></a> <span class="sansserif">JavaScript 1.0: Create a <span class="mono">String</span> object only by quoting characters.</span>
            </p>
            <p>
              <a name="1199831" id="1199831"></a>
            </p>
            <p>
              <a name="1199852" id="1199852"></a> <span class="sansserif">JavaScript 1.1, NES 2.0: added <span class="mono">String</span> constructor; added <span class="mono">prototype</span> property; added <a href="string.html#1194452">split</a> method; added ability to pass strings among scripts in different windows or frames (in previous releases, you had to add an empty string to another window's string to refer to it).</span>
            </p>
            <p>
              <a name="1199832" id="1199832"></a>
            </p>
            <p>
              <a name="1199861" id="1199861"></a> <span class="sansserif">JavaScript 1.2, NES 3.0: added <a href="string.html#1196678">concat</a>, <a href="string.html#1205239">match</a>, <a href="string.html#1194258">replace</a>, <a href="string.html#1194332">search</a>, <a href="string.html#1194366">slice</a>, and <a href="string.html#1194618">substr</a> methods.</span>
            </p>
            <p>
              <a name="1193172" id="1193172"></a>
            </p>
            <p>
              <a name="1199870" id="1199870"></a> <span class="sansserif">JavaScript 1.3: added <a href="string.html#1194796">toSource</a> method; changed <a href="string.html#1196647">charCodeAt</a>, <a href="string.html#1225094">fromCharCode</a>, and <a href="string.html#1194258">replace</a> methods.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1203114" id="1203114"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1203116" id="1203116"></a> <span class="sansserif">ECMA-262</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1199477" id="1199477"></a> <a name="Created by" id="Created by"></a> <span class="sansserif"><b>Created by</b></span><br>
         <a name="1193175" id="1193175"></a> <span class="sansserif">The <span class="mono">String</span> constructor:</span>
      </p>
      <p>
        <a name="1193176" id="1193176"></a><span class="mono">new String(<i>string</i>)</span>
      </p>
      <p>
        <br>
         <a name="1193177" id="1193177"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1193183" id="1193183"></a> <span class="sansserif"><br></span>
      </p><br>
       
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1193180" id="1193180"></a> <span class="mono">string</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193182" id="1193182"></a> <span class="sansserif">Any string.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1193184" id="1193184"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1228794" id="1228794"></a> <span class="sansserif">The <span class="mono">String</span> object is a wrapper around the string primitive data type. Do not confuse a string literal with the <span class="mono">String</span> object. For example, the following code creates the string literal <span class="mono">s1</span> and also the <span class="mono">String</span> object <span class="mono">s2</span>:</span>
      </p>
      <p>
        <a name="1228795" id="1228795"></a><span class="mono">s1 = "foo" // creates a string literal value<br>
         s2 = new String("foo") // creates a String object</span>
      </p>
      <p>
        <a name="1228796" id="1228796"></a> <span class="sansserif">You can call any of the methods of the <span class="mono">String</span> object on a string literal value-JavaScript automatically converts the string literal to a temporary <span class="mono">String</span> object, calls the method, then discards the temporary <span class="mono">String</span> object. You can also use the <span class="mono">String.length</span> property with a string literal.</span>
      </p>
      <p>
        <a name="1237619" id="1237619"></a> <span class="sansserif">You should use string literals unless you specifically need to use a <span class="mono">String</span> object, because <span class="mono">String</span> objects can have counterintuitive behavior. For example:</span>
      </p>
      <p>
        <a name="1237620" id="1237620"></a><span class="mono">s1 = "2 + 2" // creates a string literal value<br>
         s2 = new String("2 + 2") // creates a String object<br>
         eval(s1) &nbsp;&nbsp;&nbsp;&nbsp;// returns the number 4<br>
         eval(s2) &nbsp;&nbsp;&nbsp;&nbsp;// returns the string "2 + 2"</span>
      </p>
      <p>
        <a name="1193186" id="1193186"></a> <span class="sansserif">A string can be represented as a literal enclosed by single or double quotation marks; for example, "Netscape" or `Netscape'.</span>
      </p>
      <p>
        <a name="1228443" id="1228443"></a> <span class="sansserif">You can convert the value of any object into a string using the top-level <a href="toplev.html#1064506">String</a> function.</span>
      </p>
      <p>
        <br>
         <a name="1193187" id="1193187"></a> <a name="Property Summary" id="Property Summary"></a> <span class="sansserif"><b>Property Summary</b></span><br>
         <a name="1193207" id="1193207"></a> <span class="sansserif"><br></span>
      </p><br>
       
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr bgcolor="#CCCCCC" align="left" valign="top">
          <th valign="top" align="left">
            <a name="1193190" id="1193190"></a> 
            <p class="alignleft">
              <span class="sansserif"><b>Property</b></span>
            </p>
          </th>
          <th valign="top" align="left">
            <a name="1193192" id="1193192"></a> 
            <p class="alignleft">
              <span class="sansserif"><b>Description</b></span>
            </p>
          </th>
        </tr>
        <tr>
          <td valign="top">
            <a name="1214599" id="1214599"></a> <span class="mono"><a href="string.html#1214362">constructor</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1214601" id="1214601"></a> <span class="sansserif">Specifies the function that creates an object's prototype.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193197" id="1193197"></a> <span class="mono"><a href="string.html#1193437">length</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193199" id="1193199"></a> <span class="sansserif">Reflects the length of the string.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193204" id="1193204"></a> <span class="mono"><a href="string.html#1193463">prototype</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193206" id="1193206"></a> <span class="sansserif">Allows the addition of properties to a <span class="mono">String</span> object.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1193208" id="1193208"></a> <a name="Method Summary" id="Method Summary"></a> <span class="sansserif"><b>Method Summary</b></span><br>
         <a name="1193420" id="1193420"></a> <span class="sansserif"><br></span>
      </p><br>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr bgcolor="#CCCCCC" align="left" valign="top">
          <th valign="top" align="left">
            <a name="1193211" id="1193211"></a> 
            <p class="alignleft">
              <span class="sansserif"><b>Method</b></span>
            </p>
          </th>
          <th valign="top" align="left">
            <a name="1193213" id="1193213"></a> 
            <p class="alignleft">
              <span class="sansserif"><b>Description</b></span>
            </p>
          </th>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193218" id="1193218"></a> <span class="mono"><a href="string.html#1196382">anchor</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193220" id="1193220"></a> <span class="sansserif">Creates an HTML anchor that is used as a hypertext target.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193225" id="1193225"></a> <span class="mono"><a href="string.html#1196447">big</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193227" id="1193227"></a> <span class="sansserif">Causes a string to be displayed in a big font as if it were in a <span class="mono">BIG</span> tag.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193232" id="1193232"></a> <span class="mono"><a href="string.html#1196495">blink</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193234" id="1193234"></a> <span class="sansserif">Causes a string to blink as if it were in a <span class="mono">BLINK</span> tag.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193239" id="1193239"></a> <span class="mono"><a href="string.html#1196546">bold</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193241" id="1193241"></a> <span class="sansserif">Causes a string to be displayed as if it were in a <span class="mono">B</span> tag.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193246" id="1193246"></a> <span class="mono"><a href="string.html#1196596">charAt</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193249" id="1193249"></a> <span class="sansserif">Returns the character at the specified index.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193254" id="1193254"></a> <span class="mono"><a href="string.html#1196647">charCodeAt</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193256" id="1193256"></a> <span class="sansserif">Returns a number indicating the Unicode value of the character at the given index.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193261" id="1193261"></a> <span class="mono"><a href="string.html#1196678">concat</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193263" id="1193263"></a> <span class="sansserif">Combines the text of two strings and returns a new string.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193268" id="1193268"></a> <span class="mono"><a href="string.html#1196715">fixed</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193270" id="1193270"></a> <span class="sansserif">Causes a string to be displayed in fixed-pitch font as if it were in a <span class="mono">TT</span> tag.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193275" id="1193275"></a> <span class="mono"><a href="string.html#1196753">fontcolor</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193277" id="1193277"></a> <span class="sansserif">Causes a string to be displayed in the specified color as if it were in a <span class="mono">&lt;FONT COLOR=color&gt;</span> tag.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193282" id="1193282"></a> <span class="mono"><a href="string.html#1196806">fontsize</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193284" id="1193284"></a> <span class="sansserif">Causes a string to be displayed in the specified font size as if it were in a <span class="mono">&lt;FONT SIZE=size&gt;</span> tag.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193289" id="1193289"></a> <span class="mono"><a href="string.html#1225094">fromCharCode</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193292" id="1193292"></a> <span class="sansserif">Returns a string created by using the specified sequence of Unicode values. This is a method on the String class, not on a String instance.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193297" id="1193297"></a> <span class="mono"><a href="string.html#1196895">indexOf</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193299" id="1193299"></a> <span class="sansserif">Returns the index within the calling <span class="mono">String</span> object of the first occurrence of the specified value, or -1 if not found.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193304" id="1193304"></a> <span class="mono"><a href="string.html#1196955">italics</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193306" id="1193306"></a> <span class="sansserif">Causes a string to be italic, as if it were in an <span class="mono">I</span> tag.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193311" id="1193311"></a> <span class="mono"><a href="string.html#1197005">lastIndexOf</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193313" id="1193313"></a> <span class="sansserif">Returns the index within the calling <span class="mono">String</span> object of the last occurrence of the specified value, or -1 if not found.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193318" id="1193318"></a> <span class="mono"><a href="string.html#1198070">link</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193320" id="1193320"></a> <span class="sansserif">Creates an HTML hypertext link that requests another URL.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193325" id="1193325"></a> <span class="mono"><a href="string.html#1205239">match</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193327" id="1193327"></a> <span class="sansserif">Used to match a regular expression against a string.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193332" id="1193332"></a> <span class="mono"><a href="string.html#1194258">replace</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193334" id="1193334"></a> <span class="sansserif">Used to find a match between a regular expression and a string, and to replace the matched substring with a new substring.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193339" id="1193339"></a> <span class="mono"><a href="string.html#1194332">search</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193341" id="1193341"></a> <span class="sansserif">Executes the search for a match between a regular expression and a specified string.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193346" id="1193346"></a> <span class="mono"><a href="string.html#1194366">slice</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193348" id="1193348"></a> <span class="sansserif">Extracts a section of a string and returns a new string.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193353" id="1193353"></a> <span class="mono"><a href="string.html#1194405">small</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193355" id="1193355"></a> <span class="sansserif">Causes a string to be displayed in a small font, as if it were in a <span class="mono">SMALL</span> tag.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193360" id="1193360"></a> <span class="mono"><a href="string.html#1194452">split</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193362" id="1193362"></a> <span class="sansserif">Splits a <span class="mono">String</span> object into an array of strings by separating the string into substrings.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193367" id="1193367"></a> <span class="mono"><a href="string.html#1194525">strike</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193369" id="1193369"></a> <span class="sansserif">Causes a string to be displayed as struck-out text, as if it were in a <span class="mono">STRIKE</span> tag.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193374" id="1193374"></a> <span class="mono"><a href="string.html#1194575">sub</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193376" id="1193376"></a> <span class="sansserif">Causes a string to be displayed as a subscript, as if it were in a <span class="mono">SUB</span> tag.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193381" id="1193381"></a> <span class="mono"><a href="string.html#1194618">substr</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193383" id="1193383"></a> <span class="sansserif">Returns the characters in a string beginning at the specified location through the specified number of characters.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193388" id="1193388"></a> <span class="mono"><a href="string.html#1194665">substring</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193390" id="1193390"></a> <span class="sansserif">Returns the characters in a string between two indexes into the string.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193395" id="1193395"></a> <span class="mono"><a href="string.html#1194721">sup</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193397" id="1193397"></a> <span class="sansserif">Causes a string to be displayed as a superscript, as if it were in a <span class="mono">SUP</span> tag.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193402" id="1193402"></a> <span class="mono"><a href="string.html#1194765">toLowerCase</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193405" id="1193405"></a> <span class="sansserif">Returns the calling string value converted to lowercase.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193410" id="1193410"></a> <span class="mono"><a href="string.html#1194796">toSource</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193412" id="1193412"></a> <span class="sansserif">Returns an object literal representing the specified object; you can use this value to create a new object. Overrides the <a href="object.html#1193320">Object.toSource</a> method.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1210567" id="1210567"></a> <span class="mono"><a href="string.html#1210667">toString</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1210569" id="1210569"></a> <span class="sansserif">Returns a string representing the specified object. Overrides the <a href="object.html#1193350">Object.toString</a> method.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193417" id="1193417"></a> <span class="mono"><a href="string.html#1194823">toUpperCase</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193419" id="1193419"></a> <span class="sansserif">Returns the calling string value converted to uppercase.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1210650" id="1210650"></a> <span class="mono"><a href="string.html#1210732">valueOf</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1210652" id="1210652"></a> <span class="sansserif">Returns the primitive value of the specified object. Overrides the <a href="object.html#1193540">Object.valueOf</a> method.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <a name="1214335" id="1214335"></a> <span class="sansserif">In addition, this object inherits the <a href="object.html#1193628">watch</a> and <a href="object.html#1193499">unwatch</a> methods from <a href="object.html#1193136">Object</a>.</span>
      </p>
      <p>
        <br>
         <a name="1193421" id="1193421"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1193422" id="1193422"></a> <span class="sansserif"><b>Example 1: String literal.</b> The following statement creates a string literal:</span>
      </p>
      <p>
        <a name="1193423" id="1193423"></a><span class="mono">var last_name = "Schaefer"</span>
      </p>
      <p>
        <a name="1193424" id="1193424"></a> <span class="sansserif"><b>Example 2: String literal properties.</b> The following statements evaluate to 8, <span class="mono">"SCHAEFER,"</span> and <span class="mono">"schaefer"</span>:</span>
      </p>
      <p>
        <a name="1193425" id="1193425"></a> <span class="mono">last_name.length<br>
         last_name.toUpperCase()<br>
         last_name.toLowerCase()</span>
      </p>
      <p>
        <a name="1193426" id="1193426"></a> <span class="sansserif"><b>Example 3: Accessing individual characters in a string.</b> You can think of a string as an array of characters. In this way, you can access the individual characters in the string by indexing that array. For example, the following code displays "The first character in the string is H":</span>
      </p>
      <p>
        <a name="1193427" id="1193427"></a><span class="mono">var myString = "Hello"<br>
         myString[0] // returns "H"</span>
      </p>
      <p>
        <a name="1193429" id="1193429"></a> <span class="sansserif"><b>Example 4: Pass a string among scripts in different windows or frames.</b> The following code creates two string variables and opens a second window:</span>
      </p>
      <p>
        <a name="1193430" id="1193430"></a><span class="mono">var lastName = "Schaefer"<br>
         var firstName = "Jesse"<br>
         empWindow=window.open('string2.html','window1','width=300,height=300')</span>
      </p>
      <p>
        <a name="1193431" id="1193431"></a> <span class="sansserif">If the HTML source for the second window (<span class="mono">string2.html</span>) creates two string variables, <span class="mono">empLastName</span> and <span class="mono">empFirstName</span>, the following code in the first window assigns values to the second window's variables:</span>
      </p>
      <p>
        <a name="1193432" id="1193432"></a> <span class="mono">empWindow.empFirstName=firstName<br>
         empWindow.empLastName=lastName</span>
      </p>
      <p>
        <a name="1193433" id="1193433"></a> <span class="sansserif">The following code in the first window displays the values of the second window's variables:</span>
      </p>
      <p>
        <a name="1193434" id="1193434"></a> <span class="mono">alert('empFirstName in empWindow is ' + empWindow.empFirstName)<br>
         alert('empLastName in empWindow is ' + empWindow.empLastName)</span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1196382" id="1196382"></a> <a name="anchor" id="anchor"></a> <span class="sansserif"><b>anchor</b></span>
      </p>
      <p>
        <a name="1196396" id="1196396"></a> <span class="sansserif">Creates an HTML anchor that is used as a hypertext target.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1196386" id="1196386"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196391" id="1196391"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1196393" id="1196393"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196395" id="1196395"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196397" id="1196397"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1196398" id="1196398"></a> <span class="mono">anchor(<i>nameAttribute</i>)</span>
      </p>
      <p>
        <br>
         <a name="1196399" id="1196399"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1196405" id="1196405"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1196402" id="1196402"></a> <span class="mono">nameAttribute</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196404" id="1196404"></a> <span class="sansserif">A string.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1199314" id="1199314"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1199315" id="1199315"></a> <span class="sansserif">Use the <span class="mono">anchor</span> method with the <span class="mono">document.write</span> or <span class="mono">document.writeln</span> methods to programmatically create and display an anchor in a document. Create the anchor with the <span class="mono">anchor</span> method, and then call <span class="mono">write</span> or <span class="mono">writeln</span> to display the anchor in a document. In server-side JavaScript, use the <span class="mono">write</span> function to display the anchor.</span>
      </p>
      <p>
        <a name="1196423" id="1196423"></a> <span class="sansserif">In the syntax, the <span class="mono">text</span> string represents the literal text that you want the user to see. The <span class="mono">nameAttribute</span> string represents the <span class="mono">NAME</span> attribute of the <span class="mono">A</span> tag.</span>
      </p>
      <p>
        <a name="1199391" id="1199391"></a> <span class="sansserif">Anchors created with the <span class="mono">anchor</span> method become elements in the <span class="mono">document.anchors</span> array.</span>
      </p>
      <p>
        <br>
         <a name="1199395" id="1199395"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1196429" id="1196429"></a> <span class="sansserif">The following example opens the <span class="mono">msgWindow</span> window and creates an anchor for the table of contents:</span>
      </p>
      <p>
        <a name="1196430" id="1196430"></a><span class="mono">var myString="Table of Contents"<br>
         msgWindow.document.writeln(myString.anchor("contents_anchor"))</span>
      </p>
      <p>
        <a name="1196431" id="1196431"></a> <span class="sansserif">The previous example produces the same output as the following HTML:</span>
      </p>
      <p>
        <a name="1196432" id="1196432"></a> <span class="mono">&lt;A NAME="contents_anchor"&gt;Table of Contents&lt;/A&gt;</span>
      </p>
      <p>
        <br>
         <a name="1196440" id="1196440"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1196444" id="1196444"></a> <span class="sansserif"><a href="string.html#1198070">String.link</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1196447" id="1196447"></a> <a name="big" id="big"></a> <span class="sansserif"><b>big</b></span>
      </p>
      <p>
        <a name="1196463" id="1196463"></a> <span class="sansserif">Causes a string to be displayed in a big font as if it were in a <span class="mono">BIG</span> tag.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1196453" id="1196453"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196458" id="1196458"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1196460" id="1196460"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196462" id="1196462"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196464" id="1196464"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1196465" id="1196465"></a> <span class="mono">big()</span>
      </p>
      <p>
        <br>
         <a name="1196466" id="1196466"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1196467" id="1196467"></a> <span class="sansserif">None</span>
      </p>
      <p>
        <br>
         <a name="1205029" id="1205029"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1205033" id="1205033"></a> <span class="sansserif">Use the <span class="mono">big</span> method with the <span class="mono">write</span> or <span class="mono">writeln</span> methods to format and display a string in a document. In server-side JavaScript, use the <span class="mono">write</span> function to display the string.</span>
      </p>
      <p>
        <br>
         <a name="1196479" id="1196479"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1196480" id="1196480"></a> <span class="sansserif">The following example uses <span class="mono">string</span> methods to change the size of a string:</span>
      </p>
      <p>
        <a name="1196481" id="1196481"></a><span class="mono">var worldString="Hello, world"</span>
      </p>
      <p>
        <a name="1196482" id="1196482"></a> <span class="mono">document.write(worldString.small())<br>
         document.write("&lt;P&gt;" + worldString.big())<br>
         document.write("&lt;P&gt;" + worldString.fontsize(7))</span>
      </p>
      <p>
        <a name="1196483" id="1196483"></a> <span class="sansserif">The previous example produces the same output as the following HTML:</span>
      </p>
      <p>
        <a name="1196484" id="1196484"></a> <span class="mono">&lt;SMALL&gt;Hello, world&lt;/SMALL&gt;<br>
         &lt;P&gt;&lt;BIG&gt;Hello, world&lt;/BIG&gt;<br>
         &lt;P&gt;&lt;FONTSIZE=7&gt;Hello, world&lt;/FONTSIZE&gt;</span>
      </p>
      <p>
        <br>
         <a name="1196485" id="1196485"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1196492" id="1196492"></a> <span class="sansserif"><a href="string.html#1196806">String.fontsize</a>, <a href="string.html#1194405">String.small</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1196495" id="1196495"></a> <a name="blink" id="blink"></a> <span class="sansserif"><b>blink</b></span>
      </p>
      <p>
        <a name="1196511" id="1196511"></a> <span class="sansserif">Causes a string to blink as if it were in a <span class="mono">BLINK</span> tag.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1196501" id="1196501"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196506" id="1196506"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1196508" id="1196508"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196510" id="1196510"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196512" id="1196512"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1196513" id="1196513"></a> <span class="mono">blink()</span>
      </p>
      <p>
        <br>
         <a name="1196514" id="1196514"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1196515" id="1196515"></a> <span class="sansserif">None</span>
      </p>
      <p>
        <br>
         <a name="1196516" id="1196516"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1196523" id="1196523"></a> <span class="sansserif">Use the <span class="mono">blink</span> method with the <span class="mono">write</span> or <span class="mono">writeln</span> methods to format and display a string in a document. In server-side JavaScript, use the <span class="mono">write</span> function to display the string.</span>
      </p>
      <p>
        <br>
         <a name="1196527" id="1196527"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1196528" id="1196528"></a> <span class="sansserif">The following example uses <span class="mono">string</span> methods to change the formatting of a string:</span>
      </p>
      <p>
        <a name="1196529" id="1196529"></a><span class="mono">var worldString="Hello, world"</span>
      </p>
      <p>
        <a name="1196530" id="1196530"></a> <span class="mono">document.write(worldString.blink())<br>
         document.write("&lt;P&gt;" + worldString.bold())<br>
         document.write("&lt;P&gt;" + worldString.italics())<br>
         document.write("&lt;P&gt;" + worldString.strike())</span>
      </p>
      <p>
        <a name="1196531" id="1196531"></a> <span class="sansserif">The previous example produces the same output as the following HTML:</span>
      </p>
      <p>
        <a name="1196532" id="1196532"></a> <span class="mono">&lt;BLINK&gt;Hello, world&lt;/BLINK&gt;<br>
         &lt;P&gt;&lt;B&gt;Hello, world&lt;/B&gt;<br>
         &lt;P&gt;&lt;I&gt;Hello, world&lt;/I&gt;<br>
         &lt;P&gt;&lt;STRIKE&gt;Hello, world&lt;/STRIKE&gt;</span>
      </p>
      <p>
        <br>
         <a name="1196533" id="1196533"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1196543" id="1196543"></a> <span class="sansserif"><a href="string.html#1196546">String.bold</a>, <a href="string.html#1196955">String.italics</a>, <a href="string.html#1194525">String.strike</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1196546" id="1196546"></a> <a name="bold" id="bold"></a> <span class="sansserif"><b>bold</b></span>
      </p>
      <p>
        <a name="1196562" id="1196562"></a> <span class="sansserif">Causes a string to be displayed as bold as if it were in a <span class="mono">B</span> tag.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1196552" id="1196552"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196557" id="1196557"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1196559" id="1196559"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196561" id="1196561"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196563" id="1196563"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1196564" id="1196564"></a> <span class="mono">bold()</span>
      </p>
      <p>
        <br>
         <a name="1196565" id="1196565"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1196566" id="1196566"></a> <span class="sansserif">None</span>
      </p>
      <p>
        <br>
         <a name="1196567" id="1196567"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1196574" id="1196574"></a> <span class="sansserif">Use the <span class="mono">bold</span> method with the <span class="mono">write</span> or <span class="mono">writeln</span> methods to format and display a string in a document. In server-side JavaScript, use the <span class="mono">write</span> function to display the string.</span>
      </p>
      <p>
        <br>
         <a name="1196578" id="1196578"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1196579" id="1196579"></a> <span class="sansserif">The following example uses <span class="mono">string</span> methods to change the formatting of a string:</span>
      </p>
      <p>
        <a name="1196580" id="1196580"></a><span class="mono">var worldString="Hello, world"<br>
         document.write(worldString.blink())<br>
         document.write("&lt;P&gt;" + worldString.bold())<br>
         document.write("&lt;P&gt;" + worldString.italics())<br>
         document.write("&lt;P&gt;" + worldString.strike())</span>
      </p>
      <p>
        <a name="1196581" id="1196581"></a> <span class="sansserif">The previous example produces the same output as the following HTML:</span>
      </p>
      <p>
        <a name="1196582" id="1196582"></a> <span class="mono">&lt;BLINK&gt;Hello, world&lt;/BLINK&gt;<br>
         &lt;P&gt;&lt;B&gt;Hello, world&lt;/B&gt;<br>
         &lt;P&gt;&lt;I&gt;Hello, world&lt;/I&gt;<br>
         &lt;P&gt;&lt;STRIKE&gt;Hello, world&lt;/STRIKE&gt;</span>
      </p>
      <p>
        <br>
         <a name="1196583" id="1196583"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1196593" id="1196593"></a> <span class="sansserif"><a href="string.html#1196495">String.blink</a>, <a href="string.html#1196955">String.italics</a>, <a href="string.html#1194525">String.strike</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1196596" id="1196596"></a> <a name="charAt" id="charAt"></a> <span class="sansserif"><b>charAt</b></span>
      </p>
      <p>
        <a name="1196610" id="1196610"></a> <span class="sansserif">Returns the specified character from the string.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1196600" id="1196600"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196605" id="1196605"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1196607" id="1196607"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196609" id="1196609"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1203206" id="1203206"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1203208" id="1203208"></a> <span class="sansserif">ECMA-262</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196611" id="1196611"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1196612" id="1196612"></a> <span class="mono">charAt(<i>index</i>)</span>
      </p>
      <p>
        <br>
         <a name="1196613" id="1196613"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1196619" id="1196619"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1196616" id="1196616"></a> <span class="mono">index</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196618" id="1196618"></a> <span class="sansserif">An integer between 0 and 1 less than the length of the string.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196620" id="1196620"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1196621" id="1196621"></a> <span class="sansserif">Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character in a string called <span class="mono">stringName</span> is <span class="mono">stringName.length - 1</span>. If the <span class="mono">index</span> you supply is out of range, JavaScript returns an empty string.</span>
      </p>
      <p>
        <br>
         <a name="1196622" id="1196622"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1196623" id="1196623"></a> <span class="sansserif">The following example displays characters at different locations in the string <span class="mono">"Brave new world"</span>:</span>
      </p>
      <p>
        <a name="1196624" id="1196624"></a><span class="mono">var anyString="Brave new world"</span>
      </p>
      <p>
        <a name="1196625" id="1196625"></a> <span class="mono">document.writeln("The character at index 0 is " + anyString.charAt(0))<br>
         document.writeln("The character at index 1 is " + anyString.charAt(1))<br>
         document.writeln("The character at index 2 is " + anyString.charAt(2))<br>
         document.writeln("The character at index 3 is " + anyString.charAt(3))<br>
         document.writeln("The character at index 4 is " + anyString.charAt(4))</span>
      </p>
      <p>
        <a name="1196626" id="1196626"></a> <span class="sansserif">These lines display the following:</span>
      </p>
      <p>
        <a name="1196627" id="1196627"></a> <span class="sansserif">The character at index 0 is B<br>
         The character at index 1 is r<br>
         The character at index 2 is a<br>
         The character at index 3 is v<br>
         The character at index 4 is e</span>
      </p>
      <p>
        <br>
         <a name="1196635" id="1196635"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1196645" id="1196645"></a> <span class="sansserif"><a href="string.html#1196895">String.indexOf</a>, <a href="string.html#1197005">String.lastIndexOf</a>, <a href="string.html#1194452">String.split</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1196647" id="1196647"></a> <a name="charCodeAt" id="charCodeAt"></a> <span class="sansserif"><b>charCodeAt</b></span>
      </p>
      <p>
        <a name="1196648" id="1196648"></a> <span class="sansserif">Returns a number indicating the Unicode value of the character at the given index.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1196651" id="1196651"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196656" id="1196656"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1196658" id="1196658"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196660" id="1196660"></a> <span class="sansserif">JavaScript 1.2, NES 3.0</span>
            </p>
            <p>
              <a name="1223347" id="1223347"></a>
            </p>
            <p>
              <a name="1223334" id="1223334"></a> <span class="sansserif">JavaScript 1.3: returns a Unicode value rather than an ISO-Latin-1 value.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1203223" id="1203223"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1203225" id="1203225"></a> <span class="sansserif">ECMA-262</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196661" id="1196661"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1196662" id="1196662"></a> <span class="mono">charCodeAt([<i>index</i>])</span>
      </p>
      <p>
        <br>
         <a name="1196663" id="1196663"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1196669" id="1196669"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1196666" id="1196666"></a> <span class="mono">index</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196668" id="1196668"></a> <span class="sansserif">An integer between 0 and 1 less than the length of the string. The default value is 0.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196670" id="1196670"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1223000" id="1223000"></a> <span class="sansserif">Unicode values range from 0 to 65,535. The first 128 Unicode values are a direct match of the ASCII character set. For information on Unicode, see the <a href="/devedge-srce/library/manuals/2000/javascript/1.5/guide/"><i>Core JavaScript Guide</i></a>.</span>
      </p>
      <p>
        <br>
         <a name="1222874" id="1222874"></a> <a name="Backward Compatibility" id="Backward Compatibility"></a> <span class="sansserif"><b>Backward Compatibility</b></span><br>
      </p>
      <p>
        <a name="1222875" id="1222875"></a> <span class="sansserif"><b>JavaScript 1.2.</b></span> <a name="1222876" id="1222876"></a> <span class="sansserif">The <span class="mono">charCodeAt</span> method returns a number indicating the ISO-Latin-1 codeset value of the character at the given index. The ISO-Latin-1 codeset ranges from 0 to 255. The first 0 to 127 are a direct match of the ASCII character set.</span>
      </p>
      <p>
        <br>
         <a name="1196672" id="1196672"></a> <a name="Example" id="Example"></a> <span class="sansserif"><b>Example</b></span><br>
         <a name="1226737" id="1226737"></a> <span class="sansserif">The following example returns 65, the Unicode value for A.</span>
      </p>
      <p>
        <a name="1196674" id="1196674"></a> <span class="mono">"ABC".charCodeAt(0) // returns 65</span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1196678" id="1196678"></a> <a name="concat" id="concat"></a> <span class="sansserif"><b>concat</b></span>
      </p>
      <p>
        <a name="1196692" id="1196692"></a> <span class="sansserif">Combines the text of two or more strings and returns a new string.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1196682" id="1196682"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196687" id="1196687"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1196689" id="1196689"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196691" id="1196691"></a> <span class="sansserif">JavaScript 1.2, NES 3.0</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196693" id="1196693"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1196694" id="1196694"></a> <span class="mono">concat(<i>string2</i>, <i>string3</i>[, ..., <i>stringN</i>])</span>
      </p>
      <p>
        <br>
         <a name="1196695" id="1196695"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1196705" id="1196705"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1196702" id="1196702"></a> <span class="mono">string2...<br>
             string<i>N</i></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196704" id="1196704"></a> <span class="sansserif">Strings to concatenate to this string.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196706" id="1196706"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1196707" id="1196707"></a> <span class="sansserif"><span class="mono">concat</span> combines the text from one or more strings and returns a new string. Changes to the text in one string do not affect the other string.</span>
      </p>
      <p>
        <br>
         <a name="1196708" id="1196708"></a> <a name="Example" id="Example"></a> <span class="sansserif"><b>Example</b></span><br>
         <a name="1196709" id="1196709"></a> <span class="sansserif">The following example combines two strings into a new string.</span>
      </p>
      <p>
        <a name="1222717" id="1222717"></a> <span class="mono">s1="Oh "<br>
         s2="what a beautiful "<br>
         s3="mornin'."<br>
         s4=s1.concat(s2,s3) // returns "Oh what a beautiful mornin'."</span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1214362" id="1214362"></a> <a name="constructor" id="constructor"></a> <span class="sansserif"><b>constructor</b></span>
      </p>
      <p>
        <a name="1214363" id="1214363"></a> <span class="sansserif">Specifies the function that creates an object's prototype. Note that the value of this property is a reference to the function itself, not a string containing the function's name.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1214366" id="1214366"></a> <span class="sansserif"><i>Property of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1214371" id="1214371"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1214373" id="1214373"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1214375" id="1214375"></a> <span class="sansserif">JavaScript 1.1, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1214377" id="1214377"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1214379" id="1214379"></a> <span class="sansserif">ECMA-262</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1214380" id="1214380"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1214384" id="1214384"></a> <span class="sansserif">See <a href="object.html#1193229">Object.constructor</a>.</span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1196715" id="1196715"></a> <a name="fixed" id="fixed"></a> <span class="sansserif"><b>fixed</b></span>
      </p>
      <p>
        <a name="1196730" id="1196730"></a> <span class="sansserif">Causes a string to be displayed in fixed-pitch font as if it were in a <span class="mono">TT</span> tag.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1196720" id="1196720"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196725" id="1196725"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1196727" id="1196727"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196729" id="1196729"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196731" id="1196731"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1196732" id="1196732"></a> <span class="mono">fixed()</span>
      </p>
      <p>
        <br>
         <a name="1196733" id="1196733"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1196734" id="1196734"></a> <span class="sansserif">None</span>
      </p>
      <p>
        <br>
         <a name="1196735" id="1196735"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1196742" id="1196742"></a> <span class="sansserif">Use the <span class="mono">fixed</span> method with the <span class="mono">write</span> or <span class="mono">writeln</span> methods to format and display a string in a document. In server-side JavaScript, use the <span class="mono">write</span> function to display the string.</span>
      </p>
      <p>
        <br>
         <a name="1196746" id="1196746"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1196747" id="1196747"></a> <span class="sansserif">The following example uses the <span class="mono">fixed</span> method to change the formatting of a string:</span>
      </p>
      <p>
        <a name="1196748" id="1196748"></a><span class="mono">var worldString="Hello, world"<br>
         document.write(worldString.fixed())</span>
      </p>
      <p>
        <a name="1196749" id="1196749"></a> <span class="sansserif">The previous example produces the same output as the following HTML:</span>
      </p>
      <p>
        <a name="1196750" id="1196750"></a> <span class="mono">&lt;TT&gt;Hello, world&lt;/TT&gt;</span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1196753" id="1196753"></a> <a name="fontcolor" id="fontcolor"></a> <span class="sansserif"><b>fontcolor</b></span>
      </p>
      <p>
        <a name="1196756" id="1196756"></a> <span class="sansserif">Causes a string to be displayed in the specified color as if it were in a <span class="mono">&lt;FONT COLOR=color&gt;</span> tag.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1196759" id="1196759"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196764" id="1196764"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1196766" id="1196766"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196768" id="1196768"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196769" id="1196769"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1196770" id="1196770"></a> <span class="mono">fontcolor(<i>color</i>)</span>
      </p>
      <p>
        <br>
         <a name="1196771" id="1196771"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1196782" id="1196782"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1196775" id="1196775"></a> <span class="mono">color</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196777" id="1196777"></a> <span class="sansserif">A string expressing the color as a hexadecimal RGB triplet or as a string literal. String literals for color names are listed in the <a href="/devedge-srce/library/manuals/2000/javascript/1.5/guide/"><i>Core JavaScript Guide</i></a>.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196783" id="1196783"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1196790" id="1196790"></a> <span class="sansserif">Use the <span class="mono">fontcolor</span> method with the <span class="mono">write</span> or <span class="mono">writeln</span> methods to format and display a string in a document. In server-side JavaScript, use the <span class="mono">write</span> function to display the string.</span>
      </p>
      <p>
        <a name="1196794" id="1196794"></a> <span class="sansserif">If you express <span class="mono">color</span> as a hexadecimal RGB triplet, you must use the format <span class="mono">rrggbb</span>. For example, the hexadecimal RGB values for salmon are <span class="mono">red=FA</span>, <span class="mono">green=80</span>, and <span class="mono">blue=72</span>, so the RGB triplet for <span class="mono">salmon</span> is <span class="mono">"FA8072"</span>.</span>
      </p>
      <p>
        <a name="1196795" id="1196795"></a> <span class="sansserif">The <span class="mono">fontcolor</span> method overrides a value set in the <span class="mono">fgColor</span> property.</span>
      </p>
      <p>
        <br>
         <a name="1196796" id="1196796"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1196797" id="1196797"></a> <span class="sansserif">The following example uses the <span class="mono">fontcolor</span> method to change the color of a string:</span>
      </p>
      <p>
        <a name="1196798" id="1196798"></a><span class="mono">var worldString="Hello, world"</span>
      </p>
      <p>
        <a name="1196799" id="1196799"></a> <span class="mono">document.write(worldString.fontcolor("maroon") +<br>
         &nbsp;&nbsp;&nbsp;" is maroon in this line")<br>
         document.write("&lt;P&gt;" + worldString.fontcolor("salmon") +<br>
         &nbsp;&nbsp;&nbsp;" is salmon in this line")<br>
         document.write("&lt;P&gt;" + worldString.fontcolor("red") +<br>
         &nbsp;&nbsp;&nbsp;" is red in this line")</span>
      </p>
      <p>
        <a name="1196800" id="1196800"></a> <span class="mono">document.write("&lt;P&gt;" + worldString.fontcolor("8000") +<br>
         &nbsp;&nbsp;&nbsp;" is maroon in hexadecimal in this line")<br>
         document.write("&lt;P&gt;" + worldString.fontcolor("FA8072") +<br>
         &nbsp;&nbsp;&nbsp;" is salmon in hexadecimal in this line")<br>
         document.write("&lt;P&gt;" + worldString.fontcolor("FF00") +<br>
         &nbsp;&nbsp;&nbsp;" is red in hexadecimal in this line")</span>
      </p>
      <p>
        <a name="1196801" id="1196801"></a> <span class="sansserif">The previous example produces the same output as the following HTML:</span>
      </p>
      <p>
        <a name="1196802" id="1196802"></a> <span class="mono">&lt;FONT COLOR="maroon"&gt;Hello, world&lt;/FONT&gt; is maroon in this line<br>
         &lt;P&gt;&lt;FONT COLOR="salmon"&gt;Hello, world&lt;/FONT&gt; is salmon in this line<br>
         &lt;P&gt;&lt;FONT COLOR="red"&gt;Hello, world&lt;/FONT&gt; is red in this line</span>
      </p>
      <p>
        <a name="1196803" id="1196803"></a> <span class="mono">&lt;FONT COLOR="8000"&gt;Hello, world&lt;/FONT&gt;<br>
         is maroon in hexadecimal in this line<br>
         &lt;P&gt;&lt;FONT COLOR="FA8072"&gt;Hello, world&lt;/FONT&gt;<br>
         is salmon in hexadecimal in this line<br>
         &lt;P&gt;&lt;FONT COLOR="FF00"&gt;Hello, world&lt;/FONT&gt;<br>
         is red in hexadecimal in this line</span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1196806" id="1196806"></a> <a name="fontsize" id="fontsize"></a> <span class="sansserif"><b>fontsize</b></span>
      </p>
      <p>
        <a name="1196809" id="1196809"></a> <span class="sansserif">Causes a string to be displayed in the specified font size as if it were in a <span class="mono">&lt;FONT SIZE=size&gt;</span> tag.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1196812" id="1196812"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196817" id="1196817"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1196819" id="1196819"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196821" id="1196821"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196822" id="1196822"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1196823" id="1196823"></a> <span class="mono">fontsize(<i>size</i>)</span>
      </p>
      <p>
        <br>
         <a name="1196824" id="1196824"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1196830" id="1196830"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1196827" id="1196827"></a> <span class="mono">size</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196829" id="1196829"></a> <span class="sansserif">An integer between 1 and 7, a string representing a signed integer between 1 and 7.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196831" id="1196831"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1196838" id="1196838"></a> <span class="sansserif">Use the <span class="mono">fontsize</span> method with the <span class="mono">write</span> or <span class="mono">writeln</span> methods to format and display a string in a document. In server-side JavaScript, use the <span class="mono">write</span> function to display the string.</span>
      </p>
      <p>
        <a name="1196842" id="1196842"></a> <span class="sansserif">When you specify <span class="mono">size</span> as an integer, you set the size of <span class="mono">stringName</span> to one of the 7 defined sizes. When you specify <span class="mono">size</span> as a string such as <span class="mono">"-2"</span>, you adjust the font size of <span class="mono">stringName</span> relative to the size set in the <span class="mono">BASEFONT</span> tag.</span>
      </p>
      <p>
        <br>
         <a name="1196843" id="1196843"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1196844" id="1196844"></a> <span class="sansserif">The following example uses <span class="mono">string</span> methods to change the size of a string:</span>
      </p>
      <p>
        <a name="1196845" id="1196845"></a><span class="mono">var worldString="Hello, world"</span>
      </p>
      <p>
        <a name="1196846" id="1196846"></a> <span class="mono">document.write(worldString.small())<br>
         document.write("&lt;P&gt;" + worldString.big())<br>
         document.write("&lt;P&gt;" + worldString.fontsize(7))</span>
      </p>
      <p>
        <a name="1196847" id="1196847"></a> <span class="sansserif">The previous example produces the same output as the following HTML:</span>
      </p>
      <p>
        <a name="1196848" id="1196848"></a> <span class="mono">&lt;SMALL&gt;Hello, world&lt;/SMALL&gt;<br>
         &lt;P&gt;&lt;BIG&gt;Hello, world&lt;/BIG&gt;<br>
         &lt;P&gt;&lt;FONTSIZE=7&gt;Hello, world&lt;/FONTSIZE&gt;</span>
      </p>
      <p>
        <br>
         <a name="1196849" id="1196849"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1196856" id="1196856"></a> <span class="sansserif"><a href="string.html#1196447">String.big</a>, <a href="string.html#1194405">String.small</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1225094" id="1225094"></a> <a name="fromCharCode" id="fromCharCode"></a> <span class="sansserif"><b>fromCharCode</b></span>
      </p>
      <p>
        <a name="1225095" id="1225095"></a> <span class="sansserif">Returns a string created by using the specified sequence of Unicode values.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1225098" id="1225098"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1225103" id="1225103"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top" colspan="2" rowspan="1">
            <p>
              <a name="1225105" id="1225105"></a> <span class="sansserif"><i>Static</i></span>
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1225109" id="1225109"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1225111" id="1225111"></a> <span class="sansserif">JavaScript 1.2, NES 3.0</span>
            </p>
            <p>
              <a name="1225112" id="1225112"></a>
            </p>
            <p>
              <a name="1225113" id="1225113"></a> <span class="sansserif">JavaScript 1.3: uses a Unicode value rather than an ISO-Latin-1 value.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1225115" id="1225115"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1225117" id="1225117"></a> <span class="sansserif">ECMA-262</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196876" id="1196876"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1196877" id="1196877"></a> <span class="mono">fromCharCode(<i>num1</i>, ..., <i>numN</i>)</span>
      </p>
      <p>
        <br>
         <a name="1196878" id="1196878"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1196884" id="1196884"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1196881" id="1196881"></a> <span class="mono">num1, ..., num<i>N</i></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196883" id="1196883"></a> <span class="sansserif">A sequence of numbers that are Unicode values.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196885" id="1196885"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1196886" id="1196886"></a> <span class="sansserif">This method returns a string and not a <span class="mono">String</span> object.</span>
      </p>
      <p>
        <a name="1196887" id="1196887"></a> <span class="sansserif">Because <span class="mono">fromCharCode</span> is a static method of <span class="mono">String</span>, you always use it as <span class="mono">String.fromCharCode()</span>, rather than as a method of a <span class="mono">String</span> object you created.</span>
      </p>
      <p>
        <br>
         <a name="1223667" id="1223667"></a> <a name="Backward Compatibility" id="Backward Compatibility"></a> <span class="sansserif"><b>Backward Compatibility</b></span><br>
      </p>
      <p>
        <a name="1223668" id="1223668"></a> <span class="sansserif"><b>JavaScript 1.2.</b></span> <a name="1223669" id="1223669"></a> <span class="sansserif">The <span class="mono">fromCharCode</span> method returns a string created by using the specified sequence of ISO-Latin-1 codeset values.</span>
      </p>
      <p>
        <br>
         <a name="1196888" id="1196888"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1196889" id="1196889"></a> <span class="sansserif">The following example returns the string "ABC".</span>
      </p>
      <p>
        <a name="1196890" id="1196890"></a> <span class="mono">String.fromCharCode(65,66,67)</span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1196895" id="1196895"></a> <a name="indexOf" id="indexOf"></a> <span class="sansserif"><b>indexOf</b></span>
      </p>
      <p>
        <a name="1196897" id="1196897"></a> <span class="sansserif">Returns the index within the calling <span class="mono">String</span> object of the first occurrence of the specified value, starting the search at <span class="mono">fromIndex</span>, or -1 if the value is not found.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1196900" id="1196900"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196905" id="1196905"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1196907" id="1196907"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196909" id="1196909"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1203410" id="1203410"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1203412" id="1203412"></a> <span class="sansserif">ECMA-262</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196910" id="1196910"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1196911" id="1196911"></a> <span class="mono">indexOf(<i>searchValue</i>[, <i>fromIndex</i>])</span>
      </p>
      <p>
        <br>
         <a name="1196912" id="1196912"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1196922" id="1196922"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1196915" id="1196915"></a> <span class="mono">searchValue</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196917" id="1196917"></a> <span class="sansserif">A string representing the value to search for.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1196919" id="1196919"></a> <span class="mono">fromIndex</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196921" id="1196921"></a> <span class="sansserif">The location within the calling string to start the search from. It can be any integer between 0 and the length of the string. The default value is 0.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196923" id="1196923"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1196924" id="1196924"></a> <span class="sansserif">Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character of a string called <span class="mono">stringName</span> is <span class="mono">stringName.length - 1</span>.</span>
      </p>
      <p>
        <a name="1222762" id="1222762"></a> <span class="mono">"Blue Whale".indexOf("Blue") &nbsp;&nbsp;&nbsp;// returns 0<br>
         "Blue Whale".indexOf("Blute") &nbsp;&nbsp;// returns -1<br>
         "Blue Whale".indexOf("Whale",0) // returns 5<br>
         "Blue Whale".indexOf("Whale",5) // returns 5<br>
         "Blue Whale".indexOf("",9) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// returns 9<br>
         "Blue Whale".indexOf("",10) &nbsp;&nbsp;&nbsp;&nbsp;// returns 10<br>
         "Blue Whale".indexOf("",11) &nbsp;&nbsp;&nbsp;&nbsp;// returns 10</span>
      </p>
      <p>
        <a name="1196926" id="1196926"></a> <span class="sansserif">The <span class="mono">indexOf</span> method is case sensitive. For example, the following expression returns -1:</span>
      </p>
      <p>
        <a name="1196927" id="1196927"></a> <span class="mono">"Blue Whale".indexOf("blue")</span>
      </p>
      <p>
        <br>
         <a name="1196928" id="1196928"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1196929" id="1196929"></a> <span class="sansserif"><b>Example 1.</b> The following example uses <span class="mono">indexOf</span> and <span class="mono">lastIndexOf</span> to locate values in the string <span class="mono">"Brave new world."</span></span>
      </p>
      <p>
        <a name="1196930" id="1196930"></a><span class="mono">var anyString="Brave new world"</span>
      </p>
      <p>
        <a name="1196931" id="1196931"></a><span class="mono">// Displays 8<br>
         document.write("&lt;P&gt;The index of the first w from the beginning is " +<br>
         &nbsp;&nbsp;&nbsp;anyString.indexOf("w"))<br>
         // Displays 10<br>
         document.write("&lt;P&gt;The index of the first w from the end is " +<br>
         &nbsp;&nbsp;&nbsp;anyString.lastIndexOf("w"))<br>
         // Displays 6<br>
         document.write("&lt;P&gt;The index of 'new' from the beginning is " +<br>
         &nbsp;&nbsp;&nbsp;anyString.indexOf("new"))<br>
         // Displays 6<br>
         document.write("&lt;P&gt;The index of 'new' from the end is " +<br>
         &nbsp;&nbsp;&nbsp;anyString.lastIndexOf("new"))</span>
      </p>
      <p>
        <a name="1196932" id="1196932"></a> <span class="sansserif"><b>Example 2.</b> The following example defines two string variables. The variables contain the same string except that the second string contains uppercase letters. The first <span class="mono">writeln</span> method displays 19. But because the <span class="mono">indexOf</span> method is case sensitive, the string <span class="mono">"cheddar"</span> is not found in <span class="mono">myCapString</span>, so the second <span class="mono">writeln</span> method displays -1.</span>
      </p>
      <p>
        <a name="1196939" id="1196939"></a> <span class="mono">myString="brie, pepper jack, cheddar"<br>
         myCapString="Brie, Pepper Jack, Cheddar"<br>
         document.writeln('myString.indexOf("cheddar") is ' +<br>
         &nbsp;&nbsp;&nbsp;myString.indexOf("cheddar"))<br>
         document.writeln('&lt;P&gt;myCapString.indexOf("cheddar") is ' +<br>
         &nbsp;&nbsp;&nbsp;myCapString.indexOf("cheddar"))</span>
      </p>
      <p>
        <a name="1196940" id="1196940"></a> <span class="sansserif"><b>Example 3.</b> The following example sets <span class="mono">count</span> to the number of occurrences of the letter <span class="mono">x</span> in the string <span class="mono">str</span>:</span>
      </p>
      <p>
        <a name="1196941" id="1196941"></a> <span class="mono">count = 0;<br>
         pos = str.indexOf("x");<br>
         while ( pos != -1 ) {<br>
         &nbsp;&nbsp;&nbsp;count++;<br>
         &nbsp;&nbsp;&nbsp;pos = str.indexOf("x",pos+1);<br>
         }</span>
      </p>
      <p>
        <br>
         <a name="1196942" id="1196942"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1196952" id="1196952"></a> <span class="sansserif"><a href="string.html#1196596">String.charAt</a>, <a href="string.html#1197005">String.lastIndexOf</a>, <a href="string.html#1194452">String.split</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1196955" id="1196955"></a> <a name="italics" id="italics"></a> <span class="sansserif"><b>italics</b></span>
      </p>
      <p>
        <a name="1196970" id="1196970"></a> <span class="sansserif">Causes a string to be italic, as if it were in an &lt;<span class="mono">I</span>&gt; tag.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1196960" id="1196960"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196965" id="1196965"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1196967" id="1196967"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1196969" id="1196969"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1196971" id="1196971"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1196972" id="1196972"></a> <span class="mono">italics()</span>
      </p>
      <p>
        <br>
         <a name="1196973" id="1196973"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1196974" id="1196974"></a> <span class="sansserif">None</span>
      </p>
      <p>
        <br>
         <a name="1196975" id="1196975"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1196982" id="1196982"></a> <span class="sansserif">Use the <span class="mono">italics</span> method with the <span class="mono">write</span> or <span class="mono">writeln</span> methods to format and display a string in a document. In server-side JavaScript, use the <span class="mono">write</span> function to display the string.</span>
      </p>
      <p>
        <br>
         <a name="1196986" id="1196986"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1196987" id="1196987"></a> <span class="sansserif">The following example uses <span class="mono">string</span> methods to change the formatting of a string:</span>
      </p>
      <p>
        <a name="1196988" id="1196988"></a><span class="mono">var worldString="Hello, world"</span>
      </p>
      <p>
        <a name="1196989" id="1196989"></a> <span class="mono">document.write(worldString.blink())<br>
         document.write("&lt;P&gt;" + worldString.bold())<br>
         document.write("&lt;P&gt;" + worldString.italics())<br>
         document.write("&lt;P&gt;" + worldString.strike())</span>
      </p>
      <p>
        <a name="1196990" id="1196990"></a> <span class="sansserif">The previous example produces the same output as the following HTML:</span>
      </p>
      <p>
        <a name="1196991" id="1196991"></a> <span class="mono">&lt;BLINK&gt;Hello, world&lt;/BLINK&gt;<br>
         &lt;P&gt;&lt;B&gt;Hello, world&lt;/B&gt;<br>
         &lt;P&gt;&lt;I&gt;Hello, world&lt;/I&gt;<br>
         &lt;P&gt;&lt;STRIKE&gt;Hello, world&lt;/STRIKE&gt;</span>
      </p>
      <p>
        <br>
         <a name="1196992" id="1196992"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1197002" id="1197002"></a> <span class="sansserif"><a href="string.html#1196495">String.blink</a>, <a href="string.html#1196546">String.bold</a>, <a href="string.html#1194525">String.strike</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1197005" id="1197005"></a> <a name="lastIndexOf" id="lastIndexOf"></a> <span class="sansserif"><b>lastIndexOf</b></span>
      </p>
      <p>
        <a name="1197006" id="1197006"></a> <span class="sansserif">Returns the index within the calling <span class="mono">String</span> object of the last occurrence of the specified value, or -1 if not found. The calling string is searched backward, starting at <span class="mono">fromIndex</span>.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1197009" id="1197009"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1197014" id="1197014"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1197016" id="1197016"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1197018" id="1197018"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1203436" id="1203436"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1203438" id="1203438"></a> <span class="sansserif">ECMA-262</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1197019" id="1197019"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1197020" id="1197020"></a> <span class="mono">lastIndexOf(<i>searchValue</i>[, <i>fromIndex</i>])</span>
      </p>
      <p>
        <br>
         <a name="1197021" id="1197021"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1197031" id="1197031"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1197024" id="1197024"></a> <span class="mono">searchValue</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1197026" id="1197026"></a> <span class="sansserif">A string representing the value to search for.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1197028" id="1197028"></a> <span class="mono">fromIndex</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1197030" id="1197030"></a> <span class="sansserif">The location within the calling string to start the search from. It can be any integer between 0 and the length of the string. The default value is the length of the string.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1197032" id="1197032"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1197033" id="1197033"></a> <span class="sansserif">Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character is <span class="mono">stringName</span>.length - 1.</span>
      </p>
      <p>
        <a name="1227074" id="1227074"></a> <span class="mono">"canal".lastIndexOf("a") &nbsp;&nbsp;// returns 3<br>
         "canal".lastIndexOf("a",2) // returns 1<br>
         "canal".lastIndexOf("a",0) // returns -1<br>
         "canal".lastIndexOf("x") &nbsp;&nbsp;// returns -1</span>
      </p>
      <p>
        <a name="1197034" id="1197034"></a> <span class="sansserif">The <span class="mono">lastIndexOf</span> method is case sensitive. For example, the following expression returns -1:</span>
      </p>
      <p>
        <a name="1197035" id="1197035"></a> <span class="mono">"Blue Whale, Killer Whale".lastIndexOf("blue")</span>
      </p>
      <p>
        <br>
         <a name="1197036" id="1197036"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1197037" id="1197037"></a> <span class="sansserif">The following example uses <span class="mono">indexOf</span> and <span class="mono">lastIndexOf</span> to locate values in the string <span class="mono">"Brave new world."</span></span>
      </p>
      <p>
        <a name="1197038" id="1197038"></a><span class="mono">var anyString="Brave new world"</span>
      </p>
      <p>
        <a name="1197039" id="1197039"></a><span class="mono">// Displays 8<br>
         document.write("&lt;P&gt;The index of the first w from the beginning is " +<br>
         &nbsp;&nbsp;&nbsp;anyString.indexOf("w"))<br>
         // Displays 10<br>
         document.write("&lt;P&gt;The index of the first w from the end is " +<br>
         &nbsp;&nbsp;&nbsp;anyString.lastIndexOf("w"))<br>
         // Displays 6<br>
         document.write("&lt;P&gt;The index of 'new' from the beginning is " +<br>
         &nbsp;&nbsp;&nbsp;anyString.indexOf("new"))<br>
         // Displays 6<br>
         document.write("&lt;P&gt;The index of 'new' from the end is " +<br>
         &nbsp;&nbsp;&nbsp;anyString.lastIndexOf("new"))</span>
      </p>
      <p>
        <br>
         <a name="1197047" id="1197047"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1197057" id="1197057"></a> <span class="sansserif"><a href="string.html#1196596">String.charAt</a>, <a href="string.html#1196895">String.indexOf</a>, <a href="string.html#1194452">String.split</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1193437" id="1193437"></a> <a name="length" id="length"></a> <span class="sansserif"><b>length</b></span>
      </p>
      <p>
        <a name="1193455" id="1193455"></a> <span class="sansserif">The length of the string.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1193441" id="1193441"></a> <span class="sansserif"><i>Property of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193446" id="1193446"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top" colspan="2" rowspan="1">
            <p>
              <a name="1193448" id="1193448"></a> <span class="sansserif"><i>Read-only</i></span>
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1193452" id="1193452"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193454" id="1193454"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1203449" id="1203449"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1203451" id="1203451"></a> <span class="sansserif">ECMA-262</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1193456" id="1193456"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1193457" id="1193457"></a> <span class="sansserif">For a null string, length is 0.</span>
      </p>
      <p>
        <br>
         <a name="1193458" id="1193458"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1193459" id="1193459"></a> <span class="sansserif">The following example displays 8 in an Alert dialog box:</span>
      </p>
      <p>
        <a name="1193460" id="1193460"></a><span class="mono">var x="Netscape"<br>
         alert("The string length is " + x.length)</span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1198070" id="1198070"></a> <a name="link" id="link"></a> <span class="sansserif"><b>link</b></span>
      </p>
      <p>
        <a name="1198083" id="1198083"></a> <span class="sansserif">Creates an HTML hypertext link that requests another URL.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1198073" id="1198073"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1198078" id="1198078"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1198080" id="1198080"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1198082" id="1198082"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1198084" id="1198084"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1198085" id="1198085"></a> <span class="mono">link(<i>hrefAttribute</i>)</span>
      </p>
      <p>
        <br>
         <a name="1198086" id="1198086"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1198092" id="1198092"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1198089" id="1198089"></a> <span class="mono">hrefAttribute</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1198091" id="1198091"></a> <span class="sansserif">Any string that specifies the <span class="mono">HREF</span> attribute of the <span class="mono">A</span> tag; it should be a valid URL (relative or absolute).</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1198093" id="1198093"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1198094" id="1198094"></a> <span class="sansserif">Use the <span class="mono">link</span> method to programmatically create a hypertext link, and then call <span class="mono">write</span> or <span class="mono">writeln</span> to display the link in a document. In server-side JavaScript, use the <span class="mono">write</span> function to display the link.</span>
      </p>
      <p>
        <a name="1198104" id="1198104"></a> <span class="sansserif">Links created with the <span class="mono">link</span> method become elements in the <span class="mono">links</span> array of the <span class="mono">document</span> object. See <span class="mono">document.links</span>.</span>
      </p>
      <p>
        <br>
         <a name="1198111" id="1198111"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1198112" id="1198112"></a> <span class="sansserif">The following example displays the word "Netscape" as a hypertext link that returns the user to the Netscape home page:</span>
      </p>
      <p>
        <a name="1198113" id="1198113"></a><span class="mono">var hotText="Netscape"<br>
         var URL="http://home.netscape.com"</span>
      </p>
      <p>
        <a name="1198114" id="1198114"></a> <span class="mono">document.write("Click to return to " + hotText.link(URL))</span>
      </p>
      <p>
        <a name="1198115" id="1198115"></a> <span class="sansserif">The previous example produces the same output as the following HTML:</span>
      </p>
      <p>
        <a name="1198116" id="1198116"></a> <span class="mono">Click to return to &lt;A HREF="http://home.netscape.com"&gt;Netscape&lt;/A&gt;</span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1205239" id="1205239"></a> <a name="match" id="match"></a> <span class="sansserif"><b>match</b></span>
      </p>
      <p>
        <a name="1198137" id="1198137"></a> <span class="sansserif">Used to match a regular expression against a string.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1198127" id="1198127"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1198132" id="1198132"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1198134" id="1198134"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1198136" id="1198136"></a> <span class="sansserif">JavaScript 1.2</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1246099" id="1246099"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1246101" id="1246101"></a> <span class="sansserif">ECMA-262 Edition 3</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1198138" id="1198138"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1198139" id="1198139"></a> <span class="mono">match(<i>regexp</i>)</span>
      </p>
      <p>
        <br>
         <a name="1198140" id="1198140"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1198146" id="1198146"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1198143" id="1198143"></a> <span class="mono">regexp</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1198145" id="1198145"></a> <span class="sansserif">Name of the regular expression. It can be a variable name or a literal.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1198147" id="1198147"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1198148" id="1198148"></a> <span class="sansserif">If the regular expression does not include the <span class="mono">g</span> flag, returns the same result that <span class="mono">RegExp.exec</span> would return on the regular expression and string. If the regular expression includes the <span class="mono">g</span> flag, returns an array of all the matches of the regular expression in the string.</span>
      </p>
      <p>
        <a name="1198149" id="1198149"></a> <span class="sansserif"><b>
         Note</b></span> <a name="1198153" id="1198153"></a> <span class="sansserif">If you execute a match simply to find true or false, use <a href="string.html#1194332">String.search</a> or the regular expression <span class="mono">test</span> method.</span>
      </p>
      <p>
        <br>
         <a name="1198154" id="1198154"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1198155" id="1198155"></a> <span class="sansserif"><b>Example 1</b>. In the following example, <span class="mono">match</span> is used to find 'Chapter' followed by 1 or more numeric characters followed by a decimal point and numeric character 0 or more times. The regular expression includes the <span class="mono">i</span> flag so that case will be ignored.</span>
      </p>
      <p>
        <a name="1198156" id="1198156"></a> <span class="mono">&lt;SCRIPT&gt;<br>
         str = "For more information, see Chapter 3.4.5.1";<br>
         re = /(chapter \d+(\.\d)*)/i;<br>
         found = str.match(re);<br>
         document.write(found);<br>
         &lt;/SCRIPT&gt;</span>
      </p>
      <p>
        <a name="1198157" id="1198157"></a> <span class="sansserif">This returns the array containing Chapter 3.4.5.1,Chapter 3.4.5.1,.1</span>
      </p>
      <p>
        <a name="1198158" id="1198158"></a> <span class="sansserif"><span class="mono">'Chapter 3.4.5.1'</span> is the first match and the first value remembered from <span class="mono">(Chapter \d+(\.\d)*)</span>.</span>
      </p>
      <p>
        <a name="1198159" id="1198159"></a> <span class="sansserif"><span class="mono">'.1'</span> is the second value remembered from <span class="mono">(\.\d)</span>.</span>
      </p>
      <p>
        <a name="1198160" id="1198160"></a> <span class="sansserif"><b>Example 2</b>. The following example demonstrates the use of the global and ignore case flags with <span class="mono">match</span>.</span>
      </p>
      <p>
        <a name="1198161" id="1198161"></a> <span class="mono">&lt;SCRIPT&gt;<br>
         str = "abcDdcba";<br>
         newArray = str.match(/d/gi);<br>
         document.write(newArray);<br>
         &lt;/SCRIPT&gt;</span>
      </p>
      <p>
        <a name="1198162" id="1198162"></a> <span class="sansserif">The returned array contains D, d.</span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1193463" id="1193463"></a> <a name="prototype" id="prototype"></a> <span class="sansserif"><b>prototype</b></span>
      </p>
      <p>
        <a name="1193464" id="1193464"></a> <span class="sansserif">Represents the prototype for this class. You can use the prototype to add properties or methods to all instances of a class. For information on prototypes, see <a href="function.html#1193426">Function.prototype</a>.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1193470" id="1193470"></a> <span class="sansserif"><i>Property of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193475" id="1193475"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1193477" id="1193477"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1193479" id="1193479"></a> <span class="sansserif">JavaScript 1.1, NES 3.0</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1203600" id="1203600"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1203602" id="1203602"></a> <span class="sansserif">ECMA-262</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
      </p>
      <p>
        <a name="1194258" id="1194258"></a> <a name="replace" id="replace"></a> <span class="sansserif"><b>replace</b></span>
      </p>
      <p>
        <a name="1194259" id="1194259"></a> <span class="sansserif">Finds a match between a regular expression and a string, and replaces the matched substring with a new substring.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1194262" id="1194262"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194267" id="1194267"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194269" id="1194269"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194271" id="1194271"></a> <span class="sansserif">JavaScript 1.2</span>
            </p>
            <p>
              <a name="1239135" id="1239135"></a>
            </p>
            <p>
              <a name="1239144" id="1239144"></a> <span class="sansserif">JavaScript 1.3: added the ability to specify a function as the second parameter.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1246174" id="1246174"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1246176" id="1246176"></a> <span class="sansserif">ECMA-262 Edition 3</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194272" id="1194272"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1194273" id="1194273"></a> <span class="mono">replace(<i>regexp</i>, <i>newSubStr</i>)<br>
         replace(<i>regexp</i>, <i>function</i>)</span>
      </p>
      <p>
        <a name="1194274" id="1194274"></a> <span class="sansserif"><i>Versions prior to JavaScript 1.3:</i></span>
      </p>
      <p>
        <a name="1194275" id="1194275"></a> <span class="mono">replace(<i>regexp</i>, <i>newSubStr</i>)</span>
      </p>
      <p>
        <br>
         <a name="1194276" id="1194276"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1194308" id="1194308"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1194279" id="1194279"></a> <span class="mono">regexp</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194281" id="1194281"></a> <span class="sansserif">The name of the regular expression. It can be a variable name or a literal.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1194283" id="1194283"></a> <span class="mono">newSubStr</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194285" id="1194285"></a> <span class="sansserif">The string to put in place of the string found with <span class="mono">regexp</span>.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1194305" id="1194305"></a> <span class="mono">function</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194307" id="1194307"></a> <span class="sansserif">A function to be invoked after the match has been performed.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194309" id="1194309"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1194310" id="1194310"></a> <span class="sansserif">This method does not change the <span class="mono">String</span> object it is called on. It simply returns a new string.</span>
      </p>
      <p>
        <a name="1194311" id="1194311"></a> <span class="sansserif">If you want to execute a global search and replace, include the <span class="mono">g</span> flag in the regular expression.</span>
      </p>
      <p>
        <a name="1246234" id="1246234"></a> <span class="sansserif"><b>Specifying a string as a parameter.</b></span> <a name="1246904" id="1246904"></a> <span class="sansserif">The replacement string can include the following special replacement patterns:</span>
      </p>
      <p>
        <a name="1247108" id="1247108"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1246893" id="1246893"></a> <span class="sansserif"><span class="mono">$$</span></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1246895" id="1246895"></a> <span class="sansserif">Inserts a '$'.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1246897" id="1246897"></a> <span class="sansserif"><span class="mono">$&amp;</span></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1246899" id="1246899"></a> <span class="sansserif">Inserts the matched substring..</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1246901" id="1246901"></a> <span class="sansserif"><span class="mono">$`</span></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1246903" id="1246903"></a> <span class="sansserif">Inserts the portion of the string that precedes the matched substring.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1247097" id="1247097"></a> <span class="sansserif"><span class="mono">$&acute;</span></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1247099" id="1247099"></a> <span class="sansserif">Inserts the portion of the string that follows the matched substring.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1247093" id="1247093"></a> <span class="sansserif">$n<br>
               or<br>
               $nn</span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1247095" id="1247095"></a> <span class="sansserif">Where <i>n</i> or <i>nn</i> are decimal digits, inserts the <i>n</i>th parenthesized submatch string.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <a name="1246667" id="1246667"></a> <span class="sansserif"><b>Specifying a function as a parameter.</b></span> <a name="1194313" id="1194313"></a> <span class="sansserif">When you specify a function as the second parameter, the function is invoked after the match has been performed. (The use of a function in this manner is often called a lambda expression.)</span>
      </p>
      <p>
        <a name="1194314" id="1194314"></a> <span class="sansserif">In your function, you can dynamically generate the string that replaces the matched substring. The result of the function call is used as the replacement value.</span>
      </p>
      <p>
        <a name="1248247" id="1248247"></a> <span class="sansserif">The nested function can use the matched substrings to determine the new string (<span class="mono">newSubStr</span>) that replaces the found substring. You get the matched substrings through the parameters of your function. The first parameter of your function holds the complete matched substring. The following <i>n</i> parameters can be used for parenthetical matches, remembered submatch strings, where <i>n</i> is the number of submatch strings in the regular expression. Finally, the last two parameters are the offset within the string where the match occurred and the string itself. For example, the following <span class="mono">replace</span> method returns XX.zzzz - XX , zzzz.</span>
      </p>
      <p>
        <a name="1194316" id="1194316"></a> <span class="mono">"XXzzzz".replace(/(X*)(z*)/,<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function (str, p1, p2, offset, s) {<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return str + " - " + p1 + " , " + p2;<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)</span>
      </p>
      <p>
        <br>
         <a name="1239183" id="1239183"></a> <a name="Backward Compatibility" id="Backward Compatibility"></a> <span class="sansserif"><b>Backward Compatibility</b></span><br>
      </p>
      <p>
        <a name="1239184" id="1239184"></a> <span class="sansserif"><b>JavaScript 1.2.</b></span> <a name="1239185" id="1239185"></a> <span class="sansserif">You cannot specify a function to be invoked after the match has been performed.</span>
      </p>
      <p>
        <br>
         <a name="1194318" id="1194318"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1194319" id="1194319"></a> <span class="sansserif"><b>Example 1</b>. In the following example, the regular expression includes the global and ignore case flags which permits <span class="mono">replace</span> to replace each occurrence of 'apples' in the string with 'oranges.'</span>
      </p>
      <p>
        <a name="1194320" id="1194320"></a> <span class="mono">&lt;SCRIPT&gt;<br>
         re = /apples/gi;<br>
         str = "Apples are round, and apples are juicy.";<br>
         newstr=str.replace(re, "oranges");<br>
         document.write(newstr)<br>
         &lt;/SCRIPT&gt;</span>
      </p>
      <p>
        <a name="1194321" id="1194321"></a> <span class="sansserif">This prints "oranges are round, and oranges are juicy."</span>
      </p>
      <p>
        <a name="1194322" id="1194322"></a> <span class="sansserif"><b>Example 2</b>. In the following example, the regular expression is defined in <span class="mono">replace</span> and includes the ignore case flag.</span>
      </p>
      <p>
        <a name="1194323" id="1194323"></a> <span class="mono">&lt;SCRIPT&gt;<br>
         str = "Twas the night before Xmas...";<br>
         newstr=str.replace(/xmas/i, "Christmas");<br>
         document.write(newstr)<br>
         &lt;/SCRIPT&gt;</span>
      </p>
      <p>
        <a name="1194324" id="1194324"></a> <span class="sansserif">This prints "Twas the night before Christmas..."</span>
      </p>
      <p>
        <a name="1194325" id="1194325"></a> <span class="sansserif"><b>Example 3.</b> The following script switches the words in the string. For the replacement text, the script uses the <span class="mono">$1</span> and <span class="mono">$2</span> replacement patterns.</span>
      </p>
      <p>
        <a name="1194326" id="1194326"></a> <span class="mono">&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt;<br>
         re = /(\w+)\s(\w+)/;<br>
         str = "John Smith";<br>
         newstr = str.replace(re, "$2, $1");<br>
         document.write(newstr)<br>
         &lt;/SCRIPT&gt;</span>
      </p>
      <p>
        <a name="1194327" id="1194327"></a> <span class="sansserif">This prints "Smith, John".</span>
      </p>
      <p>
        <a name="1194328" id="1194328"></a> <span class="sansserif"><b>Example 4.</b> The following example replaces a Fahrenheit degree with its equivalent Celsius degree. The Fahrenheit degree should be a number ending with F. The function returns the Celsius number ending with C. For example, if the input number is 212F, the function returns 100C. If the number is 0F, the function returns -17.77777777777778C.</span>
      </p>
      <p>
        <a name="1194329" id="1194329"></a> <span class="sansserif">The regular expression <span class="mono">test</span> checks for any number that ends with F. The number of Fahrenheit degree is accessible to your function through the parameter <span class="mono">$1</span>. The function sets the Celsius number based on the Fahrenheit degree passed in a string to the <span class="mono">f2c</span> function. <span class="mono">f2c</span> then returns the Celsius number. This function approximates Perl's s///e flag.</span>
      </p>
      <p>
        <a name="1194330" id="1194330"></a> <span class="mono">function f2c(x) {<br>
         &nbsp;&nbsp;&nbsp;var s = String(x)<br>
         &nbsp;&nbsp;&nbsp;var test = /(\d+(?:\.\d*)?)F\b/g<br>
         &nbsp;&nbsp;&nbsp;return s.replace<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(test,<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function (str,p1,offset,s) {<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return ((p1-32) * 5/9) + "C";<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br>
         }</span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1194332" id="1194332"></a> <a name="search" id="search"></a> <span class="sansserif"><b>search</b></span>
      </p>
      <p>
        <a name="1194334" id="1194334"></a> <span class="sansserif">Executes the search for a match between a regular expression and this <span class="mono">String</span> object.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1194337" id="1194337"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194342" id="1194342"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194344" id="1194344"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194346" id="1194346"></a> <span class="sansserif">JavaScript 1.2</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1248129" id="1248129"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1248131" id="1248131"></a> <span class="sansserif">ECMA-262 Edition 3</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194347" id="1194347"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1194348" id="1194348"></a> <span class="mono">search(<i>regexp</i>)</span>
      </p>
      <p>
        <br>
         <a name="1194349" id="1194349"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1194355" id="1194355"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1194352" id="1194352"></a> <span class="mono">regexp</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194354" id="1194354"></a> <span class="sansserif">Name of the regular expression. It can be a variable name or a literal.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194356" id="1194356"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1194357" id="1194357"></a> <span class="sansserif">If successful, <span class="mono">search</span> returns the index of the regular expression inside the string. Otherwise, it returns -1.</span>
      </p>
      <p>
        <a name="1194358" id="1194358"></a> <span class="sansserif">When you want to know whether a pattern is found in a string use <span class="mono">search</span> (similar to the regular expression <span class="mono">test</span> method); for more information (but slower execution) use <a href="string.html#1205239">match</a> (similar to the regular expression <span class="mono">exec</span> method).</span>
      </p>
      <p>
        <br>
         <a name="1194362" id="1194362"></a> <a name="Example" id="Example"></a> <span class="sansserif"><b>Example</b></span><br>
         <a name="1194363" id="1194363"></a> <span class="sansserif">The following example prints a message which depends on the success of the test.</span>
      </p>
      <p>
        <a name="1194364" id="1194364"></a> <span class="mono">function testinput(re, str){<br>
         &nbsp;&nbsp;&nbsp;if (str.search(re) != -1)<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;midstring = " contains ";<br>
         &nbsp;&nbsp;&nbsp;else<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;midstring = " does not contain ";<br>
         &nbsp;&nbsp;&nbsp;document.write (str + midstring + re.source);<br>
         }</span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1194366" id="1194366"></a> <a name="slice" id="slice"></a> <span class="sansserif"><b>slice</b></span>
      </p>
      <p>
        <a name="1194380" id="1194380"></a> <span class="sansserif">Extracts a section of a string and returns a new string.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1194370" id="1194370"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194375" id="1194375"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194377" id="1194377"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194379" id="1194379"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1248137" id="1248137"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1248139" id="1248139"></a> <span class="sansserif">ECMA-262 Edition 3</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194381" id="1194381"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1194382" id="1194382"></a> <span class="mono">slice(<i>beginslice</i>[, <i>endSlice</i>])</span>
      </p>
      <p>
        <br>
         <a name="1194383" id="1194383"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1194393" id="1194393"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1194386" id="1194386"></a> <span class="mono">beginSlice</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194388" id="1194388"></a> <span class="sansserif">The zero-based index at which to begin extraction.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1194390" id="1194390"></a> <span class="mono">endSlice</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194392" id="1194392"></a> <span class="sansserif">The zero-based index at which to end extraction. If omitted, <span class="mono">slice</span> extracts to the end of the string.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194394" id="1194394"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1194395" id="1194395"></a> <span class="sansserif"><span class="mono">slice</span> extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string.</span>
      </p>
      <p>
        <a name="1194396" id="1194396"></a> <span class="sansserif"><span class="mono">slice</span> extracts up to but not including <span class="mono">endSlice</span>. <span class="mono">string.slice(1,4)</span> extracts the second character through the fourth character (characters indexed 1, 2, and 3).</span>
      </p>
      <p>
        <a name="1194397" id="1194397"></a> <span class="sansserif">As a negative index, <span class="mono">endSlice</span> indicates an offset from the end of the string. <span class="mono">string.slice(2,-1)</span> extracts the third character through the second to last character in the string.</span>
      </p>
      <p>
        <br>
         <a name="1194398" id="1194398"></a> <a name="Example" id="Example"></a> <span class="sansserif"><b>Example</b></span><br>
         <a name="1194399" id="1194399"></a> <span class="sansserif">The following example uses <span class="mono">slice</span> to create a new string.</span>
      </p>
      <p>
        <a name="1194400" id="1194400"></a> <span class="mono">&lt;SCRIPT&gt;<br>
         str1="The morning is upon us. "<br>
         str2=str1.slice(3,-5)<br>
         document.write(str2)<br>
         &lt;/SCRIPT&gt;</span>
      </p>
      <p>
        <a name="1194401" id="1194401"></a> <span class="sansserif">This writes:</span>
      </p>
      <p>
        <a name="1194402" id="1194402"></a> <span class="sansserif">morning is upon</span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1194405" id="1194405"></a> <a name="small" id="small"></a> <span class="sansserif"><b>small</b></span>
      </p>
      <p>
        <a name="1194420" id="1194420"></a> <span class="sansserif">Causes a string to be displayed in a small font, as if it were in a &lt;<span class="mono">SMALL</span>&gt; tag.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1194410" id="1194410"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194415" id="1194415"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194417" id="1194417"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194419" id="1194419"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194421" id="1194421"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1194422" id="1194422"></a> <span class="mono">small()</span>
      </p>
      <p>
        <br>
         <a name="1194423" id="1194423"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1194424" id="1194424"></a> <span class="sansserif">None</span>
      </p>
      <p>
        <br>
         <a name="1194425" id="1194425"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1194432" id="1194432"></a> <span class="sansserif">Use the <span class="mono">small</span> method with the <span class="mono">write</span> or <span class="mono">writeln</span> methods to format and display a string in a document. In server-side JavaScript, use the <span class="mono">write</span> function to display the string.</span>
      </p>
      <p>
        <br>
         <a name="1194436" id="1194436"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1194437" id="1194437"></a> <span class="sansserif">The following example uses <span class="mono">string</span> methods to change the size of a string:</span>
      </p>
      <p>
        <a name="1194438" id="1194438"></a><span class="mono">var worldString="Hello, world"</span>
      </p>
      <p>
        <a name="1194439" id="1194439"></a> <span class="mono">document.write(worldString.small())<br>
         document.write("&lt;P&gt;" + worldString.big())<br>
         document.write("&lt;P&gt;" + worldString.fontsize(7))</span>
      </p>
      <p>
        <a name="1194440" id="1194440"></a> <span class="sansserif">The previous example produces the same output as the following HTML:</span>
      </p>
      <p>
        <a name="1194441" id="1194441"></a> <span class="mono">&lt;SMALL&gt;Hello, world&lt;/SMALL&gt;<br>
         &lt;P&gt;&lt;BIG&gt;Hello, world&lt;/BIG&gt;<br>
         &lt;P&gt;&lt;FONTSIZE=7&gt;Hello, world&lt;/FONTSIZE&gt;</span>
      </p>
      <p>
        <br>
         <a name="1194442" id="1194442"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1194449" id="1194449"></a> <span class="sansserif"><a href="string.html#1196447">String.big</a>, <a href="string.html#1196806">String.fontsize</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1194452" id="1194452"></a> <a name="split" id="split"></a> <span class="sansserif"><b>split</b></span>
      </p>
      <p>
        <a name="1194454" id="1194454"></a> <span class="sansserif">Splits a <span class="mono">String</span> object into an array of strings by separating the string into substrings.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1194457" id="1194457"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194462" id="1194462"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194464" id="1194464"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194466" id="1194466"></a> <span class="sansserif">JavaScript 1.1, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1203665" id="1203665"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1203667" id="1203667"></a> <span class="sansserif">ECMA-262 (if separator is a string)<br>
               ECMA-262 Edition 3 (if separator is a regular expression)</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194467" id="1194467"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1194468" id="1194468"></a> <span class="mono">split([<i>separator</i>][, <i>limit</i>])</span>
      </p>
      <p>
        <br>
         <a name="1194469" id="1194469"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1194479" id="1194479"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1194472" id="1194472"></a> <span class="mono">separator</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194474" id="1194474"></a> <span class="sansserif">Specifies the character to use for separating the string. The <span class="mono">separator</span> is treated as a string or a regular expression. If <span class="mono">separator</span> is omitted, the array returned contains one element consisting of the entire string.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1194476" id="1194476"></a> <span class="mono">limit</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194478" id="1194478"></a> <span class="sansserif">Integer specifying a limit on the number of splits to be found.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194480" id="1194480"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1194481" id="1194481"></a> <span class="sansserif">The <span class="mono">split</span> method returns the new array.</span>
      </p>
      <p>
        <a name="1194482" id="1194482"></a> <span class="sansserif">When found, <span class="mono">separator</span> is removed from the string and the substrings are returned in an array. If <span class="mono">separator</span> is omitted, the array contains one element consisting of the entire string.</span>
      </p>
      <p>
        <a name="1194483" id="1194483"></a> <span class="sansserif">In JavaScript 1.2 or later, <span class="mono">split</span> has the following additions:</span>
      </p>
      <ul>
        <li class="nobullet">
          <a name="1194484" id="1194484"></a>
        </li>
        <li>
          <span class="sansserif">It can take a regular expression argument, as well as a fixed string, by which to split the object string. If <span class="mono">separator</span> is a regular expression, any included parenthesis cause submatches to be included in the returned array.</span> 
          <p>
            <a name="1194485" id="1194485"></a>
          </p>
        </li>
        <li>
          <span class="sansserif">It can take a limit count so that the resulting array does not include trailing empty elements.</span> 
          <p>
            <a name="1194486" id="1194486"></a>
          </p>
        </li>
        <li>
          If you specify <span class="mono">LANGUAGE="JavaScript1.2"</span> in the <span class="mono">SCRIPT</span> tag, <span class="mono">string.split(" ")</span> splits on any run of 1 or more white space characters including spaces, tabs, line feeds, and carriage returns. For this behavior, <span class="mono">LANGUAGE="JavaScript1.2"</span> must be specified in the <span class="mono">&lt;SCRIPT&gt;</span> tag.
        </li>
      </ul><br>
       <a name="1194487" id="1194487"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
       <a name="1194488" id="1194488"></a> <span class="sansserif"><b>Example 1</b>. The following example defines a function that splits a string into an array of strings using the specified separator. After splitting the string, the function displays messages indicating the original string (before the split), the separator used, the number of elements in the array, and the individual array elements.</span> 
      <p>
        <a name="1194489" id="1194489"></a> <span class="mono">function splitString (stringToSplit,separator) {<br>
         &nbsp;&nbsp;&nbsp;arrayOfStrings = stringToSplit.split(separator)<br>
         &nbsp;&nbsp;&nbsp;document.write ('&lt;P&gt;The original string is: "' + stringToSplit + '"')<br>
         &nbsp;&nbsp;&nbsp;document.write ('&lt;BR&gt;The separator is: "' + separator + '"')<br>
         &nbsp;&nbsp;&nbsp;document.write ("&lt;BR&gt;The array has " + arrayOfStrings.length + " elements: ")</span>
      </p>
      <p>
        <a name="1194490" id="1194490"></a> <span class="mono">&nbsp;&nbsp;&nbsp;for (var i=0; i &lt; arrayOfStrings.length; i++) {<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.write (arrayOfStrings[i] + " / ")<br>
         &nbsp;&nbsp;&nbsp;}<br>
         }</span>
      </p>
      <p>
        <a name="1194491" id="1194491"></a><span class="mono">var tempestString="Oh brave new world that has such people in it."<br>
         var monthString="Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec"</span>
      </p>
      <p>
        <a name="1194492" id="1194492"></a><span class="mono">var space=" "<br>
         var comma=","</span>
      </p>
      <p>
        <a name="1194493" id="1194493"></a> <span class="mono">splitString(tempestString,space)<br>
         splitString(tempestString)<br>
         splitString(monthString,comma)</span>
      </p>
      <p>
        <a name="1194494" id="1194494"></a> <span class="sansserif">This example produces the following output:</span>
      </p>
      <p>
        <a name="1194495" id="1194495"></a><span class="mono">The original string is: "Oh brave new world that has such people in it."<br>
         The separator is: " "<br>
         The array has 10 elements: Oh / brave / new / world / that / has / such / people / in / it. /</span>
      </p>
      <p>
        <a name="1194496" id="1194496"></a><span class="mono">The original string is: "Oh brave new world that has such people in it."<br>
         The separator is: "undefined"<br>
         The array has 1 elements: Oh brave new world that has such people in it. /</span>
      </p>
      <p>
        <a name="1194497" id="1194497"></a><span class="mono">The original string is: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec"<br>
         The separator is: ","<br>
         The array has 12 elements: Jan / Feb / Mar / Apr / May / Jun / Jul / Aug / Sep / Oct / Nov / Dec /</span>
      </p>
      <p>
        <a name="1194498" id="1194498"></a> <span class="sansserif"><b>Example 2</b>. Consider the following script:</span>
      </p>
      <p>
        <a name="1194499" id="1194499"></a> <span class="mono">&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt;<br>
         str="She sells seashells \nby the\n seashore"<br>
         document.write(str + "&lt;BR&gt;")<br>
         a=str.split(" ")<br>
         document.write(a)<br>
         &lt;/SCRIPT&gt;</span>
      </p>
      <p>
        <a name="1194500" id="1194500"></a> <span class="sansserif">Using <span class="mono">LANGUAGE="JavaScript1.2"</span>, this script produces</span>
      </p>
      <p>
        <a name="1194501" id="1194501"></a> <span class="mono">"She", "sells", "seashells", "by", "the", "seashore"</span>
      </p>
      <p>
        <a name="1194502" id="1194502"></a> <span class="sansserif">Without <span class="mono">LANGUAGE="JavaScript1.2"</span>, this script splits only on single space characters, producing</span>
      </p>
      <p>
        <a name="1194503" id="1194503"></a> <span class="mono">"She", "sells", , , , "seashells", "by", , , "the", "seashore"</span>
      </p>
      <p>
        <a name="1194504" id="1194504"></a> <span class="sansserif"><b>Example 3</b>. In the following example, <span class="mono">split</span> looks for 0 or more spaces followed by a semicolon followed by 0 or more spaces and, when found, removes the spaces from the string. <span class="mono">nameList</span> is the array returned as a result of <span class="mono">split</span>.</span>
      </p>
      <p>
        <a name="1194505" id="1194505"></a> <span class="mono">&lt;SCRIPT&gt;<br>
         names = "Harry Trump ;Fred Barney; Helen Rigby ; Bill Abel ;Chris Hand ";<br>
         document.write (names + "&lt;BR&gt;" + "&lt;BR&gt;");<br>
         re = /\s*;\s*/;<br>
         nameList = names.split (re);<br>
         document.write(nameList);<br>
         &lt;/SCRIPT&gt;</span>
      </p>
      <p>
        <a name="1194506" id="1194506"></a> <span class="sansserif">This prints two lines; the first line prints the original string, and the second line prints the resulting array.</span>
      </p>
      <p>
        <a name="1194507" id="1194507"></a> <span class="sansserif">Harry Trump ;Fred Barney; Helen Rigby ; Bill Abel ;Chris Hand<br>
         Harry Trump,Fred Barney,Helen Rigby,Bill Abel,Chris Hand</span>
      </p>
      <p>
        <a name="1194508" id="1194508"></a> <span class="sansserif"><b>Example 4</b>. In the following example, <span class="mono">split</span> looks for 0 or more spaces in a string and returns the first 3 splits that it finds.</span>
      </p>
      <p>
        <a name="1194509" id="1194509"></a> <span class="mono">&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt;<br>
         myVar = " Hello World. How are you doing? ";<br>
         splits = myVar.split(" ", 3);<br>
         document.write(splits)<br>
         &lt;/SCRIPT&gt;</span>
      </p>
      <p>
        <a name="1194510" id="1194510"></a> <span class="sansserif">This script displays the following:</span>
      </p>
      <p>
        <a name="1194511" id="1194511"></a> <span class="mono">["Hello", "World.", "How"]</span>
      </p>
      <p>
        <br>
         <a name="1194512" id="1194512"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1194522" id="1194522"></a> <span class="sansserif"><a href="string.html#1196596">String.charAt</a>, <a href="string.html#1196895">String.indexOf</a>, <a href="string.html#1197005">String.lastIndexOf</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1194525" id="1194525"></a> <a name="strike" id="strike"></a> <span class="sansserif"><b>strike</b></span>
      </p>
      <p>
        <a name="1194540" id="1194540"></a> <span class="sansserif">Causes a string to be displayed as struck-out text, as if it were in a &lt;<span class="mono">STRIKE</span>&gt; tag.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1194530" id="1194530"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194535" id="1194535"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194537" id="1194537"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194539" id="1194539"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194541" id="1194541"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1194542" id="1194542"></a> <span class="mono">strike()</span>
      </p>
      <p>
        <br>
         <a name="1194543" id="1194543"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1194544" id="1194544"></a> <span class="sansserif">None</span>
      </p>
      <p>
        <br>
         <a name="1194545" id="1194545"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1194552" id="1194552"></a> <span class="sansserif">Use the <span class="mono">strike</span> method with the <span class="mono">write</span> or <span class="mono">writeln</span> methods to format and display a string in a document. In server-side JavaScript, use the <span class="mono">write</span> function to display the string.</span>
      </p>
      <p>
        <br>
         <a name="1194556" id="1194556"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1194557" id="1194557"></a> <span class="sansserif">The following example uses <span class="mono">string</span> methods to change the formatting of a string:</span>
      </p>
      <p>
        <a name="1194558" id="1194558"></a><span class="mono">var worldString="Hello, world"</span>
      </p>
      <p>
        <a name="1194559" id="1194559"></a> <span class="mono">document.write(worldString.blink())<br>
         document.write("&lt;P&gt;" + worldString.bold())<br>
         document.write("&lt;P&gt;" + worldString.italics())<br>
         document.write("&lt;P&gt;" + worldString.strike())</span>
      </p>
      <p>
        <a name="1194560" id="1194560"></a> <span class="sansserif">The previous example produces the same output as the following HTML:</span>
      </p>
      <p>
        <a name="1194561" id="1194561"></a> <span class="mono">&lt;BLINK&gt;Hello, world&lt;/BLINK&gt;<br>
         &lt;P&gt;&lt;B&gt;Hello, world&lt;/B&gt;<br>
         &lt;P&gt;&lt;I&gt;Hello, world&lt;/I&gt;<br>
         &lt;P&gt;&lt;STRIKE&gt;Hello, world&lt;/STRIKE&gt;</span>
      </p>
      <p>
        <br>
         <a name="1194562" id="1194562"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1194572" id="1194572"></a> <span class="sansserif"><a href="string.html#1196495">String.blink</a>, <a href="string.html#1196546">String.bold</a>, <a href="string.html#1196955">String.italics</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1194575" id="1194575"></a> <a name="sub" id="sub"></a> <span class="sansserif"><b>sub</b></span>
      </p>
      <p>
        <a name="1194590" id="1194590"></a> <span class="sansserif">Causes a string to be displayed as a subscript, as if it were in a &lt;<span class="mono">SUB</span>&gt; tag.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1194580" id="1194580"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194585" id="1194585"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194587" id="1194587"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194589" id="1194589"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194591" id="1194591"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1194592" id="1194592"></a> <span class="mono">sub()</span>
      </p>
      <p>
        <br>
         <a name="1194593" id="1194593"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1194594" id="1194594"></a> <span class="sansserif">None</span>
      </p>
      <p>
        <br>
         <a name="1194595" id="1194595"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1194602" id="1194602"></a> <span class="sansserif">Use the <span class="mono">sub</span> method with the <span class="mono">write</span> or <span class="mono">writeln</span> methods to format and display a string in a document. In server-side JavaScript, use the <span class="mono">write</span> function to generate the HTML.</span>
      </p>
      <p>
        <br>
         <a name="1194606" id="1194606"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1194607" id="1194607"></a> <span class="sansserif">The following example uses the <span class="mono">sub</span> and <span class="mono">sup</span> methods to format a string:</span>
      </p>
      <p>
        <a name="1194608" id="1194608"></a><span class="mono">var superText="superscript"<br>
         var subText="subscript"</span>
      </p>
      <p>
        <a name="1194609" id="1194609"></a> <span class="mono">document.write("This is what a " + superText.sup() + " looks like.")<br>
         document.write("&lt;P&gt;This is what a " + subText.sub() + " looks like.")</span>
      </p>
      <p>
        <a name="1194610" id="1194610"></a> <span class="sansserif">The previous example produces the same output as the following HTML:</span>
      </p>
      <p>
        <a name="1194611" id="1194611"></a> <span class="mono">This is what a &lt;SUP&gt;superscript&lt;/SUP&gt; looks like.<br>
         &lt;P&gt;This is what a &lt;SUB&gt;subscript&lt;/SUB&gt; looks like.</span>
      </p>
      <p>
        <br>
         <a name="1194612" id="1194612"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1194616" id="1194616"></a> <span class="sansserif"><a href="string.html#1194721">String.sup</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1194618" id="1194618"></a> <a name="substr" id="substr"></a> <span class="sansserif"><b>substr</b></span>
      </p>
      <p>
        <a name="1194620" id="1194620"></a> <span class="sansserif">Returns the characters in a string beginning at the specified location through the specified number of characters.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1194623" id="1194623"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194628" id="1194628"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194630" id="1194630"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194632" id="1194632"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194633" id="1194633"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1194634" id="1194634"></a> <span class="mono">substr(<i>start</i>[, <i>length</i>])</span>
      </p>
      <p>
        <br>
         <a name="1194635" id="1194635"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1194645" id="1194645"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1194638" id="1194638"></a> <span class="mono">start</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194640" id="1194640"></a> <span class="sansserif">Location at which to begin extracting characters.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1194642" id="1194642"></a> <span class="mono">length</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194644" id="1194644"></a> <span class="sansserif">The number of characters to extract.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194646" id="1194646"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1194647" id="1194647"></a> <span class="sansserif"><span class="mono">start</span> is a character index. The index of the first character is 0, and the index of the last character is 1 less than the length of the string. <span class="mono">substr</span> begins extracting characters at <span class="mono">start</span> and collects <span class="mono">length</span> number of characters.</span>
      </p>
      <p>
        <a name="1194648" id="1194648"></a> <span class="sansserif">If <span class="mono">start</span> is positive and is the length of the string or longer, <span class="mono">substr</span> returns no characters.</span>
      </p>
      <p>
        <a name="1194649" id="1194649"></a> <span class="sansserif">If <span class="mono">start</span> is negative, <span class="mono">substr</span> uses it as a character index from the end of the string. If <span class="mono">start</span> is negative and <span class="mono">abs(start)</span> is larger than the length of the string, <span class="mono">substr</span> uses 0 is the start index.</span>
      </p>
      <p>
        <a name="1194650" id="1194650"></a> <span class="sansserif">If <span class="mono">length</span> is 0 or negative, <span class="mono">substr</span> returns no characters. If <span class="mono">length</span> is omitted, <span class="mono">start</span> extracts characters to the end of the string.</span>
      </p>
      <p>
        <br>
         <a name="1194651" id="1194651"></a> <a name="Example" id="Example"></a> <span class="sansserif"><b>Example</b></span><br>
         <a name="1194652" id="1194652"></a> <span class="sansserif">Consider the following script:</span>
      </p>
      <p>
        <a name="1194653" id="1194653"></a> <span class="mono">&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt;</span>
      </p>
      <p>
        <a name="1194654" id="1194654"></a><span class="mono">str = "abcdefghij"<br>
         document.writeln("(1,2): ", str.substr(1,2))<br>
         document.writeln("(-2,2): ", str.substr(-2,2))<br>
         document.writeln("(1): ", str.substr(1))<br>
         document.writeln("(-20, 2): ", str.substr(1,20))<br>
         document.writeln("(20, 2): ", str.substr(20,2))</span>
      </p>
      <p>
        <a name="1194655" id="1194655"></a> <span class="mono">&lt;/SCRIPT&gt;</span>
      </p>
      <p>
        <a name="1194656" id="1194656"></a> <span class="sansserif">This script displays:</span>
      </p>
      <p>
        <a name="1194657" id="1194657"></a> <span class="mono">(1,2): bc<br>
         (-2,2): ij<br>
         (1): bcdefghij<br>
         (-20, 2): bcdefghij<br>
         (20, 2):</span>
      </p>
      <p>
        <br>
         <a name="1194658" id="1194658"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1194662" id="1194662"></a> <span class="sansserif"><a href="string.html#1194665">substring</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1194665" id="1194665"></a> <a name="substring" id="substring"></a> <span class="sansserif"><b>substring</b></span>
      </p>
      <p>
        <a name="1194678" id="1194678"></a> <span class="sansserif">Returns a subset of a <span class="mono">String</span> object.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1194668" id="1194668"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194673" id="1194673"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194675" id="1194675"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194677" id="1194677"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1203753" id="1203753"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1203755" id="1203755"></a> <span class="sansserif">ECMA-262</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194679" id="1194679"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1194680" id="1194680"></a> <span class="mono">substring(<i>indexA</i>, <i>indexB</i>)</span>
      </p>
      <p>
        <br>
         <a name="1194681" id="1194681"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1194691" id="1194691"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1194684" id="1194684"></a> <span class="mono">indexA</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194686" id="1194686"></a> <span class="sansserif">An integer between 0 and 1 less than the length of the string.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1194688" id="1194688"></a> <span class="mono">indexB</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194690" id="1194690"></a> <span class="sansserif">An integer between 0 and 1 less than the length of the string.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194692" id="1194692"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1194693" id="1194693"></a> <span class="sansserif"><span class="mono">substring</span> extracts characters from <span class="mono">indexA</span> up to but not including <span class="mono">indexB</span>. In particular:</span>
      </p>
      <ul>
        <li class="nobullet">
          <a name="1194694" id="1194694"></a>
        </li>
        <li>
          <span class="sansserif">If <span class="mono">indexA</span> is less than 0, <span class="mono">indexA</span> is treated as if it were 0.</span> 
          <p>
            <a name="1194695" id="1194695"></a>
          </p>
        </li>
        <li>
          <span class="sansserif">If <span class="mono">indexB</span> is greater than <span class="mono">stringName.length</span>, <span class="mono">indexB</span> is treated as if it were <span class="mono">stringName.length</span>.</span> 
          <p>
            <a name="1194696" id="1194696"></a>
          </p>
        </li>
        <li>
          <span class="sansserif">If <span class="mono">indexA</span> equals <span class="mono">indexB</span>, <span class="mono">substring</span> returns an empty string.</span> 
          <p>
            <a name="1194697" id="1194697"></a>
          </p>
        </li>
        <li>
          If <span class="mono">indexB</span> is omitted, <span class="mono">indexA</span> extracts characters to the end of the string.
        </li>
      </ul><a name="1194698" id="1194698"></a> <span class="sansserif">In JavaScript 1.2, using <span class="mono">LANGUAGE="JavaScript1.2"</span> in the <span class="mono">SCRIPT</span> tag,</span> 
      <ul>
        <li class="nobullet">
          <a name="1194699" id="1194699"></a>
        </li>
        <li>
          If <span class="mono">indexA</span> is greater than <span class="mono">indexB</span>, JavaScript produces a runtime error (out of memory).
        </li>
      </ul><a name="1194700" id="1194700"></a> <span class="sansserif">In JavaScript 1.2, without <span class="mono">LANGUAGE="JavaScript1.2"</span> in the <span class="mono">SCRIPT</span> tag,</span> 
      <ul>
        <li class="nobullet">
          <a name="1194701" id="1194701"></a>
        </li>
        <li>
          If <span class="mono">indexA</span> is greater than <span class="mono">indexB</span>, JavaScript returns a substring beginning with <span class="mono">indexB</span> and ending with <span class="mono">indexA - 1</span>.
        </li>
      </ul><br>
       <a name="1194702" id="1194702"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
       <a name="1194703" id="1194703"></a> <span class="sansserif"><b>Example 1.</b> The following example uses <span class="mono">substring</span> to display characters from the string <span class="mono">"Netscape"</span>:</span> 
      <p>
        <a name="1194704" id="1194704"></a><span class="mono">var anyString="Netscape"</span>
      </p>
      <p>
        <a name="1194705" id="1194705"></a><span class="mono">// Displays "Net"<br>
         document.write(anyString.substring(0,3))<br>
         document.write(anyString.substring(3,0))<br>
         // Displays "cap"<br>
         document.write(anyString.substring(4,7))<br>
         document.write(anyString.substring(7,4))<br>
         // Displays "Netscap"<br>
         document.write(anyString.substring(0,7))<br>
         // Displays "Netscape"<br>
         document.write(anyString.substring(0,8))<br>
         document.write(anyString.substring(0,10))</span>
      </p>
      <p>
        <a name="1194706" id="1194706"></a> <span class="sansserif"><b>Example 2.</b> The following example replaces a substring within a string. It will replace both individual characters and substrings. The function call at the end of the example changes the string <span class="mono">"Brave New World"</span> into <span class="mono">"Brave New Web"</span>.</span>
      </p>
      <p>
        <a name="1194707" id="1194707"></a> <span class="mono">function replaceString(oldS,newS,fullS) {<br>
         // Replaces oldS with newS in the string fullS<br>
         &nbsp;&nbsp;&nbsp;for (var i=0; i&lt;fullS.length; i++) {<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (fullS.substring(i,i+oldS.length) == oldS) {<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fullS = fullS.substring(0,i)+newS+fullS.substring(i+oldS.length,fullS.length)<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
         &nbsp;&nbsp;&nbsp;}<br>
         &nbsp;&nbsp;&nbsp;return fullS<br>
         }</span>
      </p>
      <p>
        <a name="1194708" id="1194708"></a> <span class="mono">replaceString("World","Web","Brave New World")</span>
      </p>
      <p>
        <a name="1194709" id="1194709"></a> <span class="sansserif"><b>Example 3.</b> In JavaScript 1.2, using <span class="mono">LANGUAGE="JavaScript1.2"</span>, the following script produces a runtime error (out of memory).</span>
      </p>
      <p>
        <a name="1194710" id="1194710"></a> <span class="mono">&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt;<br>
         str="Netscape"<br>
         document.write(str.substring(0,3);<br>
         document.write(str.substring(3,0);<br>
         &lt;/SCRIPT&gt;</span>
      </p>
      <p>
        <a name="1194711" id="1194711"></a> <span class="sansserif">Without <span class="mono">LANGUAGE="JavaScript1.2"</span>, the above script prints the following:</span>
      </p>
      <p>
        <a name="1194712" id="1194712"></a> <span class="sansserif">Net Net</span>
      </p>
      <p>
        <a name="1194713" id="1194713"></a> <span class="sansserif">In the second <span class="mono">write</span>, the index numbers are swapped.</span>
      </p>
      <p>
        <br>
         <a name="1194714" id="1194714"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1194718" id="1194718"></a> <span class="sansserif"><a href="string.html#1194618">substr</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1194721" id="1194721"></a> <a name="sup" id="sup"></a> <span class="sansserif"><b>sup</b></span>
      </p>
      <p>
        <a name="1194736" id="1194736"></a> <span class="sansserif">Causes a string to be displayed as a superscript, as if it were in a &lt;<span class="mono">SUP</span>&gt; tag.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1194726" id="1194726"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194731" id="1194731"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194733" id="1194733"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194735" id="1194735"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194737" id="1194737"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1194738" id="1194738"></a> <span class="mono">sup()</span>
      </p>
      <p>
        <br>
         <a name="1194739" id="1194739"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1194740" id="1194740"></a> <span class="sansserif">None</span>
      </p>
      <p>
        <br>
         <a name="1194741" id="1194741"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1194748" id="1194748"></a> <span class="sansserif">Use the <span class="mono">sup</span> method with the <span class="mono">write</span> or <span class="mono">writeln</span> methods to format and display a string in a document. In server-side JavaScript, use the <span class="mono">write</span> function to generate the HTML.</span>
      </p>
      <p>
        <br>
         <a name="1194752" id="1194752"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1194753" id="1194753"></a> <span class="sansserif">The following example uses the <span class="mono">sub</span> and <span class="mono">sup</span> methods to format a string:</span>
      </p>
      <p>
        <a name="1194754" id="1194754"></a><span class="mono">var superText="superscript"<br>
         var subText="subscript"</span>
      </p>
      <p>
        <a name="1194755" id="1194755"></a> <span class="mono">document.write("This is what a " + superText.sup() + " looks like.")<br>
         document.write("&lt;P&gt;This is what a " + subText.sub() + " looks like.")</span>
      </p>
      <p>
        <a name="1194756" id="1194756"></a> <span class="sansserif">The previous example produces the same output as the following HTML:</span>
      </p>
      <p>
        <a name="1194757" id="1194757"></a> <span class="mono">This is what a &lt;SUP&gt;superscript&lt;/SUP&gt; looks like.<br>
         &lt;P&gt;This is what a &lt;SUB&gt;subscript&lt;/SUB&gt; looks like.</span>
      </p>
      <p>
        <br>
         <a name="1194758" id="1194758"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1194762" id="1194762"></a> <span class="sansserif"><a href="string.html#1194575">String.sub</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1194765" id="1194765"></a> <a name="toLowerCase" id="toLowerCase"></a> <span class="sansserif"><b>toLowerCase</b></span>
      </p>
      <p>
        <a name="1194779" id="1194779"></a> <span class="sansserif">Returns the calling string value converted to lowercase.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1194769" id="1194769"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194774" id="1194774"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194776" id="1194776"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194778" id="1194778"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1203783" id="1203783"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1203785" id="1203785"></a> <span class="sansserif">ECMA-262</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194780" id="1194780"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1194781" id="1194781"></a> <span class="mono">toLowerCase()</span>
      </p>
      <p>
        <br>
         <a name="1194782" id="1194782"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1194783" id="1194783"></a> <span class="sansserif">None</span>
      </p>
      <p>
        <br>
         <a name="1194784" id="1194784"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1194785" id="1194785"></a> <span class="sansserif">The <span class="mono">toLowerCase</span> method returns the value of the string converted to lowercase. <span class="mono">toLowerCase</span> does not affect the value of the string itself.</span>
      </p>
      <p>
        <br>
         <a name="1194786" id="1194786"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1194787" id="1194787"></a> <span class="sansserif">The following example displays the lowercase string <span class="mono">"alphabet"</span>:</span>
      </p>
      <p>
        <a name="1194788" id="1194788"></a><span class="mono">var upperText="ALPHABET"<br>
         document.write(upperText.toLowerCase())</span>
      </p>
      <p>
        <br>
         <a name="1194789" id="1194789"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1194793" id="1194793"></a> <span class="sansserif"><a href="string.html#1194823">String.toUpperCase</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1194796" id="1194796"></a> <a name="toSource" id="toSource"></a> <span class="sansserif"><b>toSource</b></span>
      </p>
      <p>
        <a name="1194798" id="1194798"></a> <span class="sansserif">Returns a string representing the source code of the object.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1194801" id="1194801"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194806" id="1194806"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194808" id="1194808"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194810" id="1194810"></a> <span class="sansserif">JavaScript 1.3</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194811" id="1194811"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1194812" id="1194812"></a> <span class="mono">toSource()</span>
      </p>
      <p>
        <br>
         <a name="1194813" id="1194813"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1194814" id="1194814"></a> <span class="sansserif">None</span>
      </p>
      <p>
        <br>
         <a name="1194815" id="1194815"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1228560" id="1228560"></a> <span class="sansserif">The <span class="mono">toSource</span> method returns the following values:</span>
      </p>
      <ul>
        <li class="nobullet">
          <a name="1228561" id="1228561"></a>
        </li>
        <li>
          <span class="sansserif">For the built-in <span class="mono">String</span> object, <span class="mono">toSource</span> returns the following string indicating that the source code is not available:</span> 
          <p>
            <a name="1228562" id="1228562"></a> <span class="mono">&nbsp;&nbsp;&nbsp;function String() {<br>
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[native code]<br>
             &nbsp;&nbsp;&nbsp;}</span>
          </p>
          <p>
            <a name="1228563" id="1228563"></a>
          </p>
        </li>
        <li>
          For instances of <span class="mono">String</span> or string literals, <span class="mono">toSource</span> returns a string representing the source code.
        </li>
      </ul><a name="1228564" id="1228564"></a> <span class="sansserif">This method is usually called internally by JavaScript and not explicitly in code.</span> 
      <p>
        <br>
      </p>
      <p>
        <a name="1210667" id="1210667"></a> <a name="toString" id="toString"></a> <span class="sansserif"><b>toString</b></span>
      </p>
      <p>
        <a name="1210684" id="1210684"></a> <span class="sansserif">Returns a string representing the specified object.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1210670" id="1210670"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1210675" id="1210675"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1210677" id="1210677"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1210679" id="1210679"></a> <span class="sansserif">JavaScript 1.1, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1210681" id="1210681"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1210683" id="1210683"></a> <span class="sansserif">ECMA-262</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1210685" id="1210685"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1210686" id="1210686"></a> <span class="mono">toString()</span>
      </p>
      <p>
        <br>
         <a name="1210687" id="1210687"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1210688" id="1210688"></a> <span class="sansserif">None.</span>
      </p>
      <p>
        <br>
         <a name="1210689" id="1210689"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1210696" id="1210696"></a> <span class="sansserif">The <a href="string.html#1193137">String</a> object overrides the <span class="mono">toString</span> method of the <a href="object.html#1193136">Object</a> object; it does not inherit <a href="object.html#1193350">Object.toString</a>. For <a href="string.html#1193137">String</a> objects, the <span class="mono">toString</span> method returns a string representation of the object.</span>
      </p>
      <p>
        <br>
         <a name="1211114" id="1211114"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1211115" id="1211115"></a> <span class="sansserif">The following example displays the string value of a String object:</span>
      </p>
      <p>
        <a name="1211116" id="1211116"></a><span class="mono">x = new String("Hello world");<br>
         alert(x.toString())&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Displays "Hello world"</span>
      </p>
      <p>
        <br>
         <a name="1210709" id="1210709"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1210713" id="1210713"></a> <span class="sansserif"><a href="object.html#1193350">Object.toString</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1194823" id="1194823"></a> <a name="toUpperCase" id="toUpperCase"></a> <span class="sansserif"><b>toUpperCase</b></span>
      </p>
      <p>
        <a name="1194836" id="1194836"></a> <span class="sansserif">Returns the calling string value converted to uppercase.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1194826" id="1194826"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194831" id="1194831"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194833" id="1194833"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194835" id="1194835"></a> <span class="sansserif">JavaScript 1.0, NES 2.0</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1203802" id="1203802"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1203804" id="1203804"></a> <span class="sansserif">ECMA-262</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1194837" id="1194837"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1194838" id="1194838"></a> <span class="mono">toUpperCase()</span>
      </p>
      <p>
        <br>
         <a name="1194839" id="1194839"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1194840" id="1194840"></a> <span class="sansserif">None</span>
      </p>
      <p>
        <br>
         <a name="1194841" id="1194841"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1194842" id="1194842"></a> <span class="sansserif">The <span class="mono">toUpperCase</span> method returns the value of the string converted to uppercase. <span class="mono">toUpperCase</span> does not affect the value of the string itself.</span>
      </p>
      <p>
        <br>
         <a name="1194843" id="1194843"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1194844" id="1194844"></a> <span class="sansserif">The following example displays the string <span class="mono">"ALPHABET"</span>:</span>
      </p>
      <p>
        <a name="1194845" id="1194845"></a><span class="mono">var lowerText="alphabet"<br>
         document.write(lowerText.toUpperCase())</span>
      </p>
      <p>
        <br>
         <a name="1194846" id="1194846"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1194850" id="1194850"></a> <span class="sansserif"><a href="string.html#1194765">String.toLowerCase</a></span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1210732" id="1210732"></a> <a name="valueOf" id="valueOf"></a> <span class="sansserif"><b>valueOf</b></span>
      </p>
      <p>
        <a name="1210749" id="1210749"></a> <span class="sansserif">Returns the primitive value of a String object.<br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1210735" id="1210735"></a> <span class="sansserif"><i>Method of</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1210740" id="1210740"></a> <span class="sansserif"><a href="string.html#1193137">String</a></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1210742" id="1210742"></a> <span class="sansserif"><i>Implemented in</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1210744" id="1210744"></a> <span class="sansserif">JavaScript 1.1</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1210746" id="1210746"></a> <span class="sansserif"><i>ECMA version</i></span> &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1210748" id="1210748"></a> <span class="sansserif">ECMA-262</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1210750" id="1210750"></a> <a name="Syntax" id="Syntax"></a> <span class="sansserif"><b>Syntax</b></span><br>
         <a name="1210751" id="1210751"></a> <span class="mono">valueOf()</span>
      </p>
      <p>
        <br>
         <a name="1210752" id="1210752"></a> <a name="Parameters" id="Parameters"></a> <span class="sansserif"><b>Parameters</b></span><br>
         <a name="1210753" id="1210753"></a> <span class="sansserif">None</span>
      </p>
      <p>
        <br>
         <a name="1210754" id="1210754"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1210761" id="1210761"></a> <span class="sansserif">The <span class="mono">valueOf</span> method of <a href="string.html#1193137">String</a> returns the primitive value of a String object as a string data type. This value is equivalent to <a href="string.html#1210667">String.toString</a>.</span>
      </p>
      <p>
        <a name="1210768" id="1210768"></a> <span class="sansserif">This method is usually called internally by JavaScript and not explicitly in code.</span>
      </p>
      <p>
        <br>
         <a name="1210769" id="1210769"></a> <a name="Examples" id="Examples"></a> <span class="sansserif"><b>Examples</b></span><br>
         <a name="1211235" id="1211235"></a><span class="mono">x = new String("Hello world");<br>
         alert(x.valueOf())&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Displays "Hello world"</span>
      </p>
      <p>
        <br>
         <a name="1210771" id="1210771"></a> <a name="See also" id="See also"></a> <span class="sansserif"><b>See also</b></span><br>
         <a name="1210775" id="1210775"></a> <span class="sansserif"><a href="string.html#1210667">String.toString</a>, <a href="object.html#1193540">Object.valueOf</a></span>
      </p>
    </blockquote>
    <blockquote>
      <br>
       <b><a class="sansserifPurple" href="regexp.html">Previous</a></b>&nbsp;&nbsp;&nbsp;&nbsp; <a href="contents.html"><b class="sansserifPurple">Contents</b></a>&nbsp;&nbsp;&nbsp;&nbsp; <a href="ix.html"><b class="sansserifPurple">Index</b></a>&nbsp;&nbsp;&nbsp;&nbsp; <a href="sun.html"><b class="sansserifPurple">Next</b></a> &nbsp;&nbsp;&nbsp;&nbsp; 
      <hr noshade="noshade" size="1">
      <span class="sansserif">Copyright &copy; 2000 <a href="http://www.netscape.com">Netscape Communications Corp.</a> All rights reserved.</span>
    </blockquote>
    <p class="alignright">
      <span class="sansserif">Last Updated <b>September 28, 2000</b></span>
    </p>
  </body>
</html>
